]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
bluestore: Fix warning in pool allocator
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 16 Nov 2016 22:13:52 +0000 (17:13 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 17 Nov 2016 03:05:24 +0000 (22:05 -0500)
Since we're not allocating anything, we should return nullptr and mark
the function noexcept. (Functions not marked noexcept are not allowed to
return nullptr.)

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/mempool.h

index 431768643b943b64dcb939f45ce772546fdb091d..dba6b559cd7b5de71bfabf7d4807c2e255b116e1 100644 (file)
@@ -418,10 +418,9 @@ DEFINE_MEMORY_POOLS_HELPER(P)
 //
 #define MEMPOOL_CLASS_HELPERS()                                                \
   void *operator new(size_t size);                                     \
-  void *operator new[](size_t size) {                                  \
+  void *operator new[](size_t size) noexcept {                         \
     assert(0 == "no array new");                                       \
-    return (void*)1;                                                   \
-  }                                                                    \
+    return nullptr; }                                                  \
   void  operator delete(void *);                                       \
   void  operator delete[](void *) { assert(0 == "no array delete"); }