add public kSlotSize to IndexedMemPool
authorGreg Nisbet <gregorynisbet@fb.com>
Fri, 25 Aug 2017 00:53:08 +0000 (17:53 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 25 Aug 2017 01:09:38 +0000 (18:09 -0700)
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

index 6b3fa53a2f631d7232bc19a0c51637a02edd6ce6..899a99e1ac76e99f3f2dc76b104995968aa44638 100644 (file)
@@ -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 {