server-skynet-source-3rd-je.../include/jemalloc/internal/spin_inlines.h
Jason Evans c4c2592c83 Update brace style.
Add braces around single-line blocks, and remove line breaks before
function-opening braces.

This resolves #537.
2017-01-20 21:43:07 -08:00

31 lines
582 B
C

#ifndef JEMALLOC_INTERNAL_SPIN_INLINES_H
#define JEMALLOC_INTERNAL_SPIN_INLINES_H
#ifndef JEMALLOC_ENABLE_INLINE
void spin_init(spin_t *spin);
void spin_adaptive(spin_t *spin);
#endif
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_SPIN_C_))
JEMALLOC_INLINE void
spin_init(spin_t *spin) {
spin->iteration = 0;
}
JEMALLOC_INLINE void
spin_adaptive(spin_t *spin) {
volatile uint64_t i;
for (i = 0; i < (KQU(1) << spin->iteration); i++) {
CPU_SPINWAIT;
}
if (spin->iteration < 63) {
spin->iteration++;
}
}
#endif
#endif /* JEMALLOC_INTERNAL_SPIN_INLINES_H */