From: Patrick Donnelly Date: Thu, 27 Jul 2017 19:04:04 +0000 (-0700) Subject: common: add warning on base class use of mempool X-Git-Tag: v13.0.1~926^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c0d0fa804ee0fa775ae18f9b7bde2317bb6af52d;p=ceph.git common: add warning on base class use of mempool Signed-off-by: Patrick Donnelly --- diff --git a/src/include/mempool.h b/src/include/mempool.h index b0f29baa00bcc..7d75ce0e6d901 100644 --- a/src/include/mempool.h +++ b/src/include/mempool.h @@ -100,6 +100,12 @@ BlueStore::Onode, we need to do (This is just because we need to name some static variables and we can't use :: in a variable name.) +XXX Note: the new operator hard-codes the allocation size to the size of the +object given in MEMPOOL_DEFINE_OBJECT_FACTORY. For this reason, you cannot +incorporate mempools into a base class without also defining a helper/factory +for the child class as well (as the base class is usually smaller than the +child class). + In order to use the STL containers, simply use the namespaced variant of the container type. For example,