IndexedMemPool - pool allocator tailored for lock-free data structures
Summary: Instances of IndexedMemPool dynamically allocate and then pool their element type (T), returning 4-byte integer indices that can be passed to the pool's operator[] method to access or obtain pointers to the actual elements. Once they are constructed, elements are never destroyed. These two features are useful for lock-free algorithms. The indexing behavior makes it easy to build tagged pointer-like-things, since a large number of elements can be managed using fewer bits than a full pointer. The pooling behavior makes it safe to read from T-s even after they have been recycled Test Plan: 1. unit tests 2. unit tests using DeterministicSchedule 3. this code is moved from tao/queues where it is in production use Reviewed By: davejwatson@fb.com FB internal diff: D1089053
Showing
folly/IndexedMemPool.h
0 → 100644
This diff is collapsed.
Please register or sign in to comment