From 37c619714bf04d6d22c6fde4beccfce86f4ff82d Mon Sep 17 00:00:00 2001 From: Greg Nisbet Date: Thu, 24 Aug 2017 17:53:08 -0700 Subject: [PATCH] add public kSlotSize to IndexedMemPool Summary: add public kSlotSize to IndexedMemPool, needed to support getting the approximate memory footprint of the pool (since a Slot has two atomic uint32_t's more than a bare Elem) Reviewed By: yfeldblum Differential Revision: D5690225 fbshipit-source-id: 667da6b67b339038b92b0e5acde17219fe1c85c5 --- folly/IndexedMemPool.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/folly/IndexedMemPool.h b/folly/IndexedMemPool.h index 6b3fa53a..899a99e1 100644 --- a/folly/IndexedMemPool.h +++ b/folly/IndexedMemPool.h @@ -506,6 +506,9 @@ struct IndexedMemPool : boost::noncopyable { void markAllocated(Slot& slot) { slot.localNext.store(uint32_t(-1), std::memory_order_release); } + + public: + static constexpr std::size_t kSlotSize = sizeof(Slot); }; namespace detail { -- 2.34.1