Arena allocator to preallocate memory for IOCP events. More...
#include <arena.hpp>
Public Member Functions | |
| void * | Allocate () |
| void | Deallocate (void *obj) |
| int | Count () const |
Arena allocator to preallocate memory for IOCP events.
This class implements an arena allocator that preallocates memory in blocks (of size PoolSize) to avoid individual heap allocations for each IOCP event structure. This is necessary for efficiency when working with the IOCP API, which may require frequent allocation and deallocation of event objects.
| T | The type of object to allocate (e.g. IOCP event structure). |
| PoolSize | The number of objects in each preallocated pool (default is 1024). |