diff --git a/include/jemalloc/internal/arena_structs_b.h b/include/jemalloc/internal/arena_structs_b.h index 49fdd17d..ebcdbc4d 100644 --- a/include/jemalloc/internal/arena_structs_b.h +++ b/include/jemalloc/internal/arena_structs_b.h @@ -36,11 +36,6 @@ struct arena_bin_info_s { bitmap_info_t bitmap_info; }; -typedef union { - size_t u; /* Used for atomic operations. */ - ssize_t s; /* Time may be negative (means "never"). */ -} arena_decay_time_t; - struct arena_decay_s { /* Synchronizes all non-atomic fields. */ malloc_mutex_t mtx; @@ -51,7 +46,7 @@ struct arena_decay_s { * * Synchronization: atomic. */ - arena_decay_time_t time; + ssize_t time; /* time / SMOOTHSTEP_NSTEPS. */ nstime_t interval; /* diff --git a/src/arena.c b/src/arena.c index f4450f34..56ab362d 100644 --- a/src/arena.c +++ b/src/arena.c @@ -470,16 +470,12 @@ arena_extent_ralloc_large_expand(tsdn_t *tsdn, arena_t *arena, extent_t *extent, static ssize_t arena_decay_time_read(arena_t *arena) { - arena_decay_time_t dt; - dt.u = atomic_read_zu(&arena->decay.time.u); - return dt.s; + return atomic_read_zd(&arena->decay.time); } static void arena_decay_time_write(arena_t *arena, ssize_t decay_time) { - arena_decay_time_t dt; - dt.s = decay_time; - atomic_write_zu(&arena->decay.time.u, dt.u); + atomic_write_zd(&arena->decay.time, decay_time); } static void