From c0d0fa804ee0fa775ae18f9b7bde2317bb6af52d Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 27 Jul 2017 12:04:04 -0700 Subject: [PATCH] common: add warning on base class use of mempool Signed-off-by: Patrick Donnelly --- src/include/mempool.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/mempool.h b/src/include/mempool.h index b0f29baa00b..7d75ce0e6d9 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, -- 2.39.5