![]() |
WPILibC++ 2025.3.2
|
This class is an allocator for the pool resource. More...
Public Types | |
| using | value_type = T |
| The type of object in the pool. | |
Public Member Functions | |
| constexpr | PoolAllocator (PoolResource *r) |
| Constructs a pool allocator with the given pool memory resource. | |
| constexpr | PoolAllocator (const PoolAllocator< T > &other)=default |
| constexpr PoolAllocator< T > & | operator= (const PoolAllocator< T > &)=default |
| constexpr T * | allocate (size_t n) |
| Returns a block of memory from the pool. | |
| constexpr void | deallocate (T *p, size_t n) |
| Gives a block of memory back to the pool. | |
This class is an allocator for the pool resource.
| T | The type of object in the pool. |
| using sleipnir::PoolAllocator< T >::value_type = T |
The type of object in the pool.
|
inlineexplicitconstexpr |
Constructs a pool allocator with the given pool memory resource.
| r | The pool resource. |
|
constexprdefault |
|
inlinenodiscardconstexpr |
Returns a block of memory from the pool.
| n | Number of bytes in the block. |
|
inlineconstexpr |
Gives a block of memory back to the pool.
| p | A pointer to the block of memory. |
| n | Number of bytes in the block. |
|
constexprdefault |