31#ifndef ETL_FIXED_MEMORY_BLOCK_POOL_INCLUDED
32#define ETL_FIXED_MEMORY_BLOCK_POOL_INCLUDED
45 template <
size_t VBlock_Size,
size_t VAlignment,
size_t VSize>
50 static ETL_CONSTANT
size_t Block_Size = VBlock_Size;
51 static ETL_CONSTANT
size_t Alignment = VAlignment;
52 static ETL_CONSTANT
size_t Size = VSize;
66 virtual void*
allocate_block(
size_t required_size,
size_t required_alignment) ETL_OVERRIDE
68 if ((required_alignment <= Alignment) &&
69 (required_size <= Block_Size) &&
72 return pool.template allocate<block>();
87 pool.
release(
static_cast<const block* const
>(pblock));
109 char data[Block_Size];
116 template <
size_t VBlock_Size,
size_t VAlignment,
size_t VSize>
117 ETL_CONSTANT
size_t fixed_sized_memory_block_allocator<VBlock_Size, VAlignment, VSize>::Block_Size;
119 template <
size_t VBlock_Size,
size_t VAlignment,
size_t VSize>
120 ETL_CONSTANT
size_t fixed_sized_memory_block_allocator<VBlock_Size, VAlignment, VSize>::Alignment;
122 template <
size_t VBlock_Size,
size_t VAlignment,
size_t VSize>
123 ETL_CONSTANT
size_t fixed_sized_memory_block_allocator<VBlock_Size, VAlignment, VSize>::Size;
Definition: fixed_sized_memory_block_allocator.h:47
virtual void * allocate_block(size_t required_size, size_t required_alignment) ETL_OVERRIDE
The overridden virtual function to allocate a block.
Definition: fixed_sized_memory_block_allocator.h:66
virtual bool is_owner_of_block(const void *const pblock) const ETL_OVERRIDE
Returns true if the allocator is the owner of the block.
Definition: fixed_sized_memory_block_allocator.h:99
fixed_sized_memory_block_allocator()
Default constructor.
Definition: fixed_sized_memory_block_allocator.h:57
virtual bool release_block(const void *const pblock) ETL_OVERRIDE
The overridden virtual function to release a block.
Definition: fixed_sized_memory_block_allocator.h:83
The interface for a memory block pool.
Definition: imemory_block_allocator.h:44
bool full() const
Definition: ipool.h:311
bool is_in_pool(const void *const p_object) const
Definition: ipool.h:260
void release(const U *const p_object)
Definition: pool.h:157
bitset_ext
Definition: absolute.h:38