Rizin
unix-like reverse engineering framework and cli tools
spin.h
Go to the documentation of this file.
1
/******************************************************************************/
2
#ifdef JEMALLOC_H_TYPES
3
4
typedef
struct
spin_s spin_t;
5
6
#endif
/* JEMALLOC_H_TYPES */
7
/******************************************************************************/
8
#ifdef JEMALLOC_H_STRUCTS
9
10
struct
spin_s {
11
unsigned
iteration;
12
};
13
14
#endif
/* JEMALLOC_H_STRUCTS */
15
/******************************************************************************/
16
#ifdef JEMALLOC_H_EXTERNS
17
18
#endif
/* JEMALLOC_H_EXTERNS */
19
/******************************************************************************/
20
#ifdef JEMALLOC_H_INLINES
21
22
#ifndef JEMALLOC_ENABLE_INLINE
23
void
spin_init
(spin_t *spin);
24
void
spin_adaptive
(spin_t *spin);
25
#endif
26
27
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_SPIN_C_))
28
JEMALLOC_INLINE
void
29
spin_init
(spin_t *spin)
30
{
31
32
spin->iteration = 0;
33
}
34
35
JEMALLOC_INLINE
void
36
spin_adaptive
(spin_t *spin)
37
{
38
volatile
uint64_t
i
;
39
40
for
(
i
= 0;
i
< (
KQU
(1) << spin->iteration);
i
++)
41
CPU_SPINWAIT
;
42
43
if
(spin->iteration < 63)
44
spin->iteration++;
45
}
46
47
#endif
48
49
#endif
/* JEMALLOC_H_INLINES */
50
/******************************************************************************/
51
i
lzma_index ** i
Definition:
index.h:629
CPU_SPINWAIT
#define CPU_SPINWAIT
Definition:
jemalloc_internal_defs.h:24
KQU
#define KQU(q)
Definition:
jemalloc_internal_macros.h:42
JEMALLOC_INLINE
#define JEMALLOC_INLINE
Definition:
jemalloc_internal_macros.h:28
spin_init
#define spin_init
Definition:
private_namespace.h:507
spin_adaptive
#define spin_adaptive
Definition:
private_namespace.h:506
uint64_t
unsigned long uint64_t
Definition:
sftypes.h:28
subprojects
rzheap
rz_jemalloc
internal
spin.h
Generated by
1.9.1