]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: add warning on base class use of mempool
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 27 Jul 2017 19:04:04 +0000 (12:04 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 7 Sep 2017 04:22:09 +0000 (21:22 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/include/mempool.h

index b0f29baa00bcc84367f036823d6ee4eb78ad0451..7d75ce0e6d90157380b0b65d95aea20c6832e37c 100644 (file)
@@ -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,