Holds given buffer as a pool.
More...
#include </home/travis/build/forGGe/theCore/lib/allocators/export/ecl/pool.hpp>
template<size_t blk_sz, size_t blk_cnt>
class ecl::pool< blk_sz, blk_cnt >
Holds given buffer as a pool.
Object of this pool can be shared by different instances of an allocator. Refer to a wiki for further info: here
◆ pool() [1/2]
template<size_t blk_sz, size_t blk_cnt>
◆ ~pool()
template<size_t blk_sz, size_t blk_cnt>
◆ pool() [2/2]
template<size_t blk_sz, size_t blk_cnt>
◆ real_alloc()
template<size_t blk_sz, size_t blk_cnt>
uint8_t * ecl::pool< blk_sz, blk_cnt >::real_alloc |
( |
size_t |
n, |
|
|
size_t |
align, |
|
|
size_t |
obj_sz |
|
) |
| |
|
overridevirtual |
Allocates chunk with respect to given alingment.
- Parameters
-
[in] | n | Object count. |
[in] | align | Required align. |
[in] | obj_sz | Size of single object. |
- Returns
- nullptr if there is no space for given type and count in the pool. Valid pointer returned otherwise.
- See also
- aligned_alloc()
Implements ecl::pool_base.
◆ real_dealloc()
template<size_t blk_sz, size_t blk_cnt>
void ecl::pool< blk_sz, blk_cnt >::real_dealloc |
( |
uint8_t * |
p, |
|
|
size_t |
n, |
|
|
size_t |
obj_sz |
|
) |
| |
|
overridevirtual |
Deallocates chunk of given address and length.
Length of chunk is determined by multiplication count of objects by object size.
- Parameters
-
[in] | p | Address of a chunk. Must be valid address, returned Previously by real_alloc(). |
[in] | n | Objects count. Must be the same as passed to real_alloc() when given chunk was allocated. |
[in] | obj_sz | Size of single object. Must be the same as passed to real_alloc() when given chunk was allocated. |
- See also
- deallocate()
Implements ecl::pool_base.
◆ operator=()
template<size_t blk_sz, size_t blk_cnt>
The documentation for this class was generated from the following file: