From: Greg Nisbet Date: Fri, 25 Aug 2017 00:53:08 +0000 (-0700) Subject: add public kSlotSize to IndexedMemPool X-Git-Tag: v2017.08.28.00~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=37c619714bf04d6d22c6fde4beccfce86f4ff82d;p=folly.git 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 --- 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 {