mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 16:43:33 +03:00
Refactor prng to not use 64-bit atomics on 32-bit platforms.
This resolves #495.
This commit is contained in:
parent
e0a9e78374
commit
04b463546e
8 changed files with 340 additions and 58 deletions
|
|
@ -325,8 +325,8 @@ extent_addr_randomize(tsdn_t *tsdn, extent_t *extent, size_t alignment)
|
|||
if (alignment < PAGE) {
|
||||
unsigned lg_range = LG_PAGE -
|
||||
lg_floor(CACHELINE_CEILING(alignment));
|
||||
uint64_t r =
|
||||
prng_lg_range(&extent_arena_get(extent)->offset_state,
|
||||
size_t r =
|
||||
prng_lg_range_zu(&extent_arena_get(extent)->offset_state,
|
||||
lg_range, true);
|
||||
uintptr_t random_offset = ((uintptr_t)r) << (LG_PAGE -
|
||||
lg_range);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue