]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer: throw assertion when posix_memalign allocations fail
authorSage Weil <sage@newdream.net>
Wed, 9 Apr 2008 18:18:45 +0000 (11:18 -0700)
committerSage Weil <sage@newdream.net>
Wed, 9 Apr 2008 18:18:45 +0000 (11:18 -0700)
src/include/buffer.h

index a6725fc6c798775dfa6869b39697a66652ca732b..387cf2e33a6e6ccaeafd8861c2a070a300f25a7b 100644 (file)
@@ -131,8 +131,10 @@ private:
 #ifdef DARWIN
       data = (char *) valloc (len);
 #else
+      data = 0;
       ::posix_memalign((void**)(void*)&data, PAGE_SIZE, len);
 #endif /* DARWIN */
+      assert(data);
       inc_total_alloc(len);
     }
     ~raw_posix_aligned() {