From f4a857da0b720691effc524469f6db895ad00d8e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 25 Apr 2018 10:31:51 +0800 Subject: [PATCH] port_posix: use posix_memalign() for aligned_alloc to workaround issue of http://tracker.ceph.com/issues/21422 . and in tcmalloc aligned_alloc and posix_memalign() are basically the same thing. the same applies to GNU glibc. Signed-off-by: Kefu Chai --- port/port_posix.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/port/port_posix.cc b/port/port_posix.cc index 2408beeb..0377d448 100644 --- a/port/port_posix.cc +++ b/port/port_posix.cc @@ -188,8 +188,6 @@ int GetMaxOpenFiles() { void *cacheline_aligned_alloc(size_t size) { #if __GNUC__ < 5 && defined(__SANITIZE_ADDRESS__) return malloc(size); -#elif defined(_ISOC11_SOURCE) - return aligned_alloc(CACHE_LINE_SIZE, size); #elif ( _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 || defined(__APPLE__)) void *m; errno = posix_memalign(&m, CACHE_LINE_SIZE, size); -- 2.47.3