mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 16:43:33 +03:00
Avoid arena->offset_state when tsd not available for prng.
Use stack locals and remove the offset_state in arena.
This commit is contained in:
parent
d01b425e5d
commit
19a51abf33
3 changed files with 2 additions and 22 deletions
|
|
@ -187,8 +187,8 @@ extent_addr_randomize(tsdn_t *tsdn, arena_t *arena, extent_t *extent,
|
|||
r = (size_t)prng_lg_range_u64(
|
||||
tsd_offset_statep_get(tsd), lg_range);
|
||||
} else {
|
||||
r = prng_lg_range_zu(&arena->offset_state, lg_range,
|
||||
true);
|
||||
uint64_t stack_value = (uint64_t)(uintptr_t)&r;
|
||||
r = (size_t)prng_lg_range_u64(&stack_value, lg_range);
|
||||
}
|
||||
uintptr_t random_offset = ((uintptr_t)r) << (LG_PAGE -
|
||||
lg_range);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue