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) &&
85 if (pool.is_in_pool(pblock))
87 pool.release(
static_cast<const block* const
>(pblock));
101 return pool.is_in_pool(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;
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
imemory_block_allocator()
Default constructor.
Definition imemory_block_allocator.h:50
void * allocate(size_t required_size, size_t required_alignment)
Definition imemory_block_allocator.h:58
Definition generic_pool.h:56
bitset_ext
Definition absolute.h:39