]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
port_posix: use posix_memalign() for aligned_alloc 36/head
authorKefu Chai <tchaikov@gmail.com>
Wed, 25 Apr 2018 02:31:51 +0000 (10:31 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 25 Apr 2018 08:14:36 +0000 (16:14 +0800)
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 <tchaikov@gmail.com>
port/port_posix.cc

index 2408beeb030bfa4d239453bbe3dd4cdec582864f..0377d448f3badfe2fecc6acdd86e9cd030cfa365 100644 (file)
@@ -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);