memory
|
An alias for memory_pool_collection using the identity_buckets policy and a PoolType
defaulting to node_pool.
Typedefs | |
using | allocator_type = make_block_allocator_t< BlockOrRawAllocator > |
using | pool_type = PoolType |
using | bucket_distribution = BucketDistribution |
Member Functions | |
void * | allocate_node (std::size_t node_size) |
void * | try_allocate_node (std::size_t node_size) noexcept |
void * | allocate_array (std::size_t count, std::size_t node_size) |
void * | try_allocate_array (std::size_t count, std::size_t node_size) noexcept |
void | deallocate_node (void *ptr, std::size_t node_size) noexcept |
bool | try_deallocate_node (void *ptr, std::size_t node_size) noexcept |
void | deallocate_array (void *ptr, std::size_t count, std::size_t node_size) noexcept |
bool | try_deallocate_array (void *ptr, std::size_t count, std::size_t node_size) noexcept |
void | reserve (std::size_t node_size, std::size_t capacity) |
std::size_t | max_node_size () const noexcept |
std::size_t | pool_capacity_left (std::size_t node_size) const noexcept |
std::size_t | capacity_left () const noexcept |
std::size_t | next_capacity () const noexcept |
allocator_type & | get_allocator () noexcept |
|
inherited |
BucketDistribution
. If it is empty, it will use an implementation defined amount of memory from the arena and inserts it in it. If the arena is empty too, it will request a new memory block from the BlockAllocator of size next_capacity() and puts part of it onto this free list. Then it removes a node from it. sizeof(T) < node_size
.
|
noexceptinherited |
nullptr
on any failure, instead of growing the arnea and possibly throwing. nullptr
in case of failure.
|
inherited |
n
continuous nodes on the appropriate free list and removing them. Depending on the PoolType
this can be a slow operation or not allowed at all. This can sometimes lead to a growth on the free list, even if technically there is enough continuous memory on the free list. Otherwise has the same behavior as allocate_node(). n
nodes of size node_size
suitable aligned. count
must be valid array count and node_size
must be valid node size.
|
noexceptinherited |
nullptr
on any failure, instead of growing the arnea and possibly throwing. nullptr
in case of failure.
|
noexceptinherited |
ptr
must be a result from a previous call to allocate_node() with the same size on the same free list, i.e. either this allocator object or a new object created by moving this to it.
|
noexceptinherited |
true
if the node could be deallocated, false
otherwise.
|
noexceptinherited |
ptr
must be a result from a previous call to allocate_array() with the same sizes on the same free list, i.e. either this allocator object or a new object created by moving this to it.
|
noexceptinherited |
true
if the array could be deallocated, false
otherwise.
|
inherited |
capacity_left
bytes from the arena onto the free list defined over the BucketDistribution
, if the arena is empty, a new memory block is requested from the BlockAllocator and it will be used. node_size
must be valid node size less than or equal to max_node_size(), capacity_left
must be less than next_capacity().
|
noexceptinherited |
|
noexceptinherited |
BucketDistribution
. This is the number of nodes that can be allocated without the free list requesting more memory from the arena.
|
noexceptinherited |
|
noexceptinherited |
PoolType
is small_node_pool, the exact usable memory is lower than that.
|
noexceptinherited |