Skip to content

Commit 28b7e42

Browse files
committed
Fix arena data structure size calculation.
Fix paren placement so that QUANTUM_CEILING() applies to the correct portion of the expression that computes how much memory to base_alloc(). In practice this bug had no impact. This was caused by 5d8db15 (Simplify run quantization.), which in turn fixed an over-allocation regression caused by 3c4d92e (Add per size class huge allocation statistics.).
1 parent 77635bf commit 28b7e42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/arena.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,8 +3461,8 @@ arena_new(tsdn_t *tsdn, unsigned ind)
34613461
if (config_stats) {
34623462
arena = (arena_t *)base_alloc(tsdn,
34633463
CACHELINE_CEILING(sizeof(arena_t)) +
3464-
QUANTUM_CEILING((nlclasses * sizeof(malloc_large_stats_t)) +
3465-
(nhclasses * sizeof(malloc_huge_stats_t))));
3464+
QUANTUM_CEILING((nlclasses * sizeof(malloc_large_stats_t)))
3465+
+ (nhclasses * sizeof(malloc_huge_stats_t)));
34663466
} else
34673467
arena = (arena_t *)base_alloc(tsdn, sizeof(arena_t));
34683468
if (arena == NULL)

0 commit comments

Comments
 (0)