From 4becdf21dceeeaaeec37043ce59d654c214363e2 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Thu, 23 Jul 2015 17:14:11 -0700 Subject: [PATCH] Fix sa2u() regression. Take large_pad into account when determining whether an aligned allocation can be satisfied by a large size class. This regression was introduced by 8a03cf039cd06f9fa6972711195055d865673966 (Implement cache index randomization for large allocations.). --- include/jemalloc/internal/jemalloc_internal.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 706c1981..29aa802a 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -708,7 +708,7 @@ sa2u(size_t size, size_t alignment) * Calculate the size of the over-size run that arena_palloc() * would need to allocate in order to guarantee the alignment. */ - if (usize + alignment - PAGE <= arena_maxrun) + if (usize + large_pad + alignment - PAGE <= arena_maxrun) return (usize); }