From: Adam C. Emerson Date: Wed, 16 Nov 2016 22:13:52 +0000 (-0500) Subject: bluestore: Fix warning in pool allocator X-Git-Tag: v11.1.0~241^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11921%2Fhead;p=ceph.git bluestore: Fix warning in pool allocator 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 --- diff --git a/src/include/mempool.h b/src/include/mempool.h index 431768643b94..dba6b559cd7b 100644 --- a/src/include/mempool.h +++ b/src/include/mempool.h @@ -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"); }