diff --git a/src/snmalloc/override/malloc.cc b/src/snmalloc/override/malloc.cc index de0eadc..5830f94 100644 --- a/src/snmalloc/override/malloc.cc +++ b/src/snmalloc/override/malloc.cc @@ -61,6 +61,12 @@ extern "C" return ThreadAlloc::get().alloc_size(ptr); } + SNMALLOC_EXPORT + size_t SNMALLOC_NAME_MANGLE(malloc_good_size)(size_t size) + { + return round_size(size); + } + SNMALLOC_EXPORT void* SNMALLOC_NAME_MANGLE(realloc)(void* ptr, size_t size) { auto& a = ThreadAlloc::get(); diff --git a/src/test/func/malloc/malloc.cc b/src/test/func/malloc/malloc.cc index e94b6a9..ec28a7d 100644 --- a/src/test/func/malloc/malloc.cc +++ b/src/test/func/malloc/malloc.cc @@ -32,7 +32,7 @@ void check_result(size_t size, size_t align, void* p, int err, bool null) failed = true; } const auto alloc_size = our_malloc_usable_size(p); - auto expected_size = round_size(size); + auto expected_size = our_malloc_good_size(size); #ifdef SNMALLOC_PASS_THROUGH // Calling system allocator may allocate a larger block than // snmalloc. Note, we have called the system allocator with