|
| | GenericPoolW (size_t sizeofObject, int numberofObjects) |
| | Construct the base pool of numberofObjects buffers of sizeofObject bytes.
|
| |
| | GenericPoolW (size_t sizeofObject, int numberofObjects, unsigned alignBoundary) |
| | Construct the base pool with buffers aligned to alignBoundary.
|
| |
| virtual | ~GenericPoolW () |
| | Does nothing; empty virtual destructor.
|
| |
| void | stop () |
| | Set the stopping flag and wake all waiting allocations, which then return nullptr.
|
| |
| | GenericPool (size_t sizeofObject, int numberofObjects) |
| | Allocate a block for numberofObjects buffers of sizeofObject bytes plus headers and put all buffers on the free list.
|
| |
| | GenericPool (size_t sizeofObject, int numberofObjects, unsigned alignBoundary) |
| | Like GenericPool(sizeofObject, numberofObjects), with each user buffer aligned to alignBoundary (the block gets alignBoundary extra bytes).
|
| |
| | ~GenericPool () |
| | Free the block.
|
| |
| void * | buffer () const |
| | Return the start of the block.
|
| |
| size_t | size () const |
| | Return the block size in bytes.
|
| |
| void | dump () const |
| | Print the block size, address and fill offset, the object size and count, and the counters to stdout.
|
| |
| virtual | ~Pool () |
| | Does nothing; empty virtual destructor.
|
| |
| | Pool (size_t sizeofObject, int numberofOfObjects) |
| | Set the object size and count and round each allocation (object plus PoolEntry header) up to a multiple of the PoolEntry size; the subclass calls populate() to create the buffers.
|
| |
| | Pool (size_t sizeofObject, int numberofOfObjects, unsigned alignBoundary) |
| | Like Pool(sizeofObject, numberofOfObjects), but rounds each allocation up to a multiple of alignBoundary.
|
| |
| void * | alloc (size_t size) |
| | Take a buffer from the free list and count the allocation; returns nullptr if size exceeds the object size or none is available.
|
| |
| virtual void | free (PoolEntry *) |
| | Return entry to the free list (enque()).
|
| |
| void | clearCounters () |
| | Zero the allocation and free counters.
|
| |
| size_t | sizeofObject () const |
| | Return the object size given to the constructor.
|
| |
| int | numberofObjects () const |
| | Return the number of buffers.
|
| |
| const uint64_t & | numberofAllocs () const |
| | Return a reference to the allocation counter.
|
| |
| const uint64_t & | numberofFrees () const |
| | Return a reference to the free counter.
|
| |
| int | numberOfAllocatedObjects () const |
| | Return allocations minus frees.
|
| |
| int | numberOfFreeObjects () const |
| | Return the number of buffers minus numberOfAllocatedObjects().
|
| |
GenericPool whose allocation blocks on a condition variable until a buffer is freed (or stop() is called); frees wake one waiter.