|
| pool_mock () |
|
| ~pool_mock () |
|
uint8_t * | real_alloc (size_t n, size_t align, size_t obj_sz) override |
| Allocates chunk with respect to given alingment. More...
|
|
void | real_dealloc (uint8_t *p, size_t n, size_t obj_sz) override |
| Deallocates chunk of given address and length. More...
|
|
template<typename T > |
T * | aligned_alloc (size_t n) |
| Allocates memory suitable for type T, with respect to its aligment. More...
|
|
template<typename T > |
void | deallocate (T *p, size_t n) |
| Deallocates memory, previously allocated by aligned_alloc. More...
|
|
virtual | ~pool_base () |
| Destroys a pool. More...
|
|
◆ pool_mock()
◆ ~pool_mock()
pool_mock::~pool_mock |
( |
| ) |
|
|
inline |
◆ real_alloc()
uint8_t* pool_mock::real_alloc |
( |
size_t |
n, |
|
|
size_t |
align, |
|
|
size_t |
obj_sz |
|
) |
| |
|
inlineoverridevirtual |
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()
void pool_mock::real_dealloc |
( |
uint8_t * |
p, |
|
|
size_t |
n, |
|
|
size_t |
obj_sz |
|
) |
| |
|
inlineoverridevirtual |
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.
The documentation for this class was generated from the following file: