Add element construction/destruction hooks to IndexedMemPool
Summary: This diff adds a Traits template parameter to IndexedMemPool that allows more control over the lifetime management of individual elements, including mixes of lazy and eager recycle semantics (or colocation of different classes of data inside a single element). It also arranges that an index is not reported as isAllocated() until it has been passed to Traits::initialize and passed to Traits::onAllocate at least once, so code that is traversing valid indexes doesn't need to deal with the post-initialize but pre-onAllocate state (it must still deal with indexes that reported isAllocated() as true but have since been passed to onRecycle). The default behavior is unchanged. Reviewed By: nbronson Differential Revision: D5177462 fbshipit-source-id: e7d22c860ab6bf25083977dfb5a63955641c9cfb
Showing
Please register or sign in to comment