mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Align FastAllocator memory to 4096 for size >= 4096
This commit is contained in:
parent
54824ec71d
commit
5f64a0942f
@ -315,14 +315,14 @@ void* FastAllocator<Size>::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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user