2 #ifdef JEMALLOC_H_TYPES
23 #define PRNG_A_32 UINT32_C(1103515241)
24 #define PRNG_C_32 UINT32_C(12347)
26 #define PRNG_A_64 UINT64_C(6364136223846793005)
27 #define PRNG_C_64 UINT64_C(1442695040888963407)
31 #ifdef JEMALLOC_H_STRUCTS
35 #ifdef JEMALLOC_H_EXTERNS
39 #ifdef JEMALLOC_H_INLINES
41 #ifndef JEMALLOC_ENABLE_INLINE
56 #if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_PRNG_C_))
61 return ((
state * PRNG_A_32) + PRNG_C_32);
68 return ((
state * PRNG_A_64) + PRNG_C_64);
75 #if LG_SIZEOF_PTR == 2
76 return ((
state * PRNG_A_32) + PRNG_C_32);
77 #elif LG_SIZEOF_PTR == 3
78 return ((
state * PRNG_A_64) + PRNG_C_64);
80 #error Unsupported pointer size
89 if (lg_range <1 || lg_range >32) {
101 state0 = atomic_read_uint32(
state);
108 ret = state1 >> (32 - lg_range);
119 if (lg_range <1 || lg_range > 64) {
129 ret = state1 >> (64 - lg_range);
148 state0 = atomic_read_z(
state);
179 }
while (ret >=
range);
198 }
while (ret >=
range);
216 }
while (ret >=
range);
#define JEMALLOC_ALWAYS_INLINE
assert(limit<=UINT32_MAX/2)
#define prng_state_next_u64
#define prng_state_next_zu
#define prng_lg_range_u64
#define prng_lg_range_u32
#define prng_state_next_u32
#define atomic_cas_uint32