diff --git a/flow/FastAlloc.cpp b/flow/FastAlloc.cpp index 1935f5a9cb..7af1b3bf86 100644 --- a/flow/FastAlloc.cpp +++ b/flow/FastAlloc.cpp @@ -315,14 +315,14 @@ void* FastAllocator::allocate() { } #if defined(USE_GPERFTOOLS) || defined(ADDRESS_SANITIZER) - // Some usages of FastAllocator<4096> require 4096 byte alignment - return aligned_alloc(Size == 4096 ? Size : alignof(void*), Size); + // Some usages of FastAllocator require 4096 byte alignment. + return aligned_alloc(Size >= 4096 ? 4096 : alignof(void*), Size); #endif #if VALGRIND if (valgrindPrecise()) { - // Some usages of FastAllocator<4096> require 4096 byte alignment - return aligned_alloc(Size == 4096 ? Size : alignof(void*), Size); + // Some usages of FastAllocator require 4096 byte alignment + return aligned_alloc(Size >= 4096 ? 4096 : alignof(void*), Size); } #endif