bit::memory
|
This block allocator uses policies to modify the behaviour of the underlying type. More...
#include <policy_block_allocator.hpp>
Public Types | |
using | lock_type = BasicLockable |
using | tracker_type = MemoryTracker |
Public Member Functions | |
policy_block_allocator ()=default | |
Default-constructs the policy_block_allocator. | |
template<typename Arg0 , typename... Args, typename = std::enable_if_t< std::is_constructible<BlockAllocator,Arg0,Args...>::value && !std::is_same<Arg0,std::decay_t<policy_block_allocator>>::value>> | |
policy_block_allocator (Arg0 &&arg0, Args &&...args) | |
Constructs the underlying block allocator by forwarding the arguments to it. More... | |
policy_block_allocator (policy_block_allocator &&other)=default | |
Move-constructs this policy_block_allocator from an existing one. More... | |
policy_block_allocator (const policy_block_allocator &other)=default | |
Copy-constructs this policy_block_allocator from an existing one. More... | |
~policy_block_allocator () | |
Destructs the policy_block_allocator, finalizing any leak tracking. | |
policy_block_allocator & | operator= (policy_block_allocator &&other)=default |
Move-assigns this policy_block_allocator from an existing one. More... | |
policy_block_allocator & | operator= (const policy_block_allocator &other)=default |
Copy-assigns this policy_block_allocator from an existing one. More... | |
owner< memory_block > | allocate_block () |
Allocates a memory block using the underliny allocator. More... | |
void | deallocate_block (owner< memory_block > block) |
Deallocates the specified memory block. More... | |
const tracker_type & | tracker () const noexcept |
Accesses the tracker from the arena_allocator. More... | |
allocator_info | info () const noexcept |
Gets the info about this current block allocator, or null otherwise. More... | |
std::size_t | next_block_size () const noexcept |
Queries the next block size expected from this allocator. More... | |
This block allocator uses policies to modify the behaviour of the underlying type.
This block allocator acts and behaves identically to the underlying BlockAllocator by proxying the same functions defined in the BlockAllocator concept.
BlockAllocator | The block allocator to use |
MemoryTagger | A class used for tagging memory on allocations and on deallocations. |
MemoryTracker | A class used for tracking memory allocations. |
BoundsChecker | A class used for bounds checking; used to catch buffer-overflow issues |
BasicLockable | A lockable type for thread-synchronization |
Definition at line 101 of file policy_block_allocator.hpp.
bit::memory::policy_block_allocator< BlockAllocator, MemoryTagger, MemoryTracker, BasicLockable >::policy_block_allocator | ( | Arg0 && | arg0, |
Args &&... | args | ||
) |
Constructs the underlying block allocator by forwarding the arguments to it.
args | the arguments to forward to the underlying block allocator |
|
default |
Move-constructs this policy_block_allocator from an existing one.
other | the other allocator to move |
|
default |
Copy-constructs this policy_block_allocator from an existing one.
other | the other allocator to copy |
owner<memory_block> bit::memory::policy_block_allocator< BlockAllocator, MemoryTagger, MemoryTracker, BasicLockable >::allocate_block | ( | ) |
Allocates a memory block using the underliny allocator.
void bit::memory::policy_block_allocator< BlockAllocator, MemoryTagger, MemoryTracker, BasicLockable >::deallocate_block | ( | owner< memory_block > | block | ) |
Deallocates the specified memory block.
block | the block to deallocate |
|
noexcept |
Gets the info about this current block allocator, or null otherwise.
info()
|
noexcept |
Queries the next block size expected from this allocator.
|
default |
Move-assigns this policy_block_allocator from an existing one.
other | the other allocator to move |
(*this)
|
default |
Copy-assigns this policy_block_allocator from an existing one.
other | the other allocator to copy |
(*this)
|
noexcept |
Accesses the tracker from the arena_allocator.