Documentation of memory
template<class RawAllocator = default_allocator, unsigned Num = 2, unsigned Den = 1>
class foonathan::memory::growing_block_allocator< RawAllocator, Num, Den >
It calls the
allocate_array() function with a node of size
1 and maximum alignment on the used allocator for the block allocation. The size of the next memory block will grow by a given factor after each allocation, allowing an amortized constant allocation time in the higher level allocator. The factor can be given as rational in the template parameter, default is
|using||allocator_type = typename traits::allocator_type|
|static float||growth_factor () noexcept|
|growing_block_allocator (std::size_t block_size, allocator_type alloc=allocator_type()) noexcept|
|void||deallocate_block (memory_block block) noexcept|
|std::size_t||next_block_size () const noexcept|
|allocator_type &||get_allocator () noexcept|
- Creates it by giving it the initial block size, the allocator object and the growth factor. By default, it uses a default-constructed allocator object and a growth factor of
block_sizemust be greater than 0.
- Deallocates a previously allocated memory block. This does not decrease the block size.
blockmust be previously returned by a call to allocate_block().
- The size of the memory block returned by the next call to allocate_block().
- A reference to the used RawAllocator object.
- The growth factor.
Generated by 1.8.12