|
Allocator Builder
Policy Based C++ Template Allocator Library
|
#include <shared_heap.hpp>
Public Types | |
| using | allocator = Allocator |
Public Member Functions | |
| shared_heap (size_t numberOfChunks, size_t chunkSize) noexcept | |
| shared_heap (shared_heap &&x) noexcept | |
| shared_heap & | operator= (shared_heap &&x) noexcept |
| size_t | number_of_chunk () const noexcept |
| size_t | chunk_size () const noexcept |
| bool | owns (const block &b) const noexcept |
| block | allocate (size_t n) noexcept |
| void | deallocate (block &b) noexcept |
| void | deallocate_all () noexcept |
| bool | reallocate (block &b, size_t n) noexcept |
| bool | expand (block &b, size_t delta) noexcept |
Static Public Attributes | |
| static constexpr bool | supports_truncated_deallocation = true |
| static constexpr unsigned | alignment = Allocator::alignment |
The SharedHeap implements a classic heap with a pre-allocated size of numberOfChunks_.value() * chunk_size_.value() It has a overhead of one bit per block and linear complexity for allocation and deallocation operations. It is thread safe, except the moment of instantiation. As far as possible only a shared lock + an atomic operation is used during the memory operations
Definition at line 49 of file shared_heap.hpp.