30 #ifndef BIT_MEMORY_UTILITIES_MEMORY_BLOCK_CACHE_HPP 31 #define BIT_MEMORY_UTILITIES_MEMORY_BLOCK_CACHE_HPP 33 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 35 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 38 #include "memory_block.hpp" 39 #include "pointer_utilities.hpp" 40 #include "uninitialized_storage.hpp" 94 bool empty()
const noexcept;
102 std::size_t
size()
const noexcept;
113 bool contains(
const void* ptr )
const noexcept;
142 template<
typename BlockAllocator>
158 void store_block( owner<memory_block> block ) noexcept;
191 #include "detail/memory_block_cache.inl" void store_block(owner< memory_block > block) noexcept
Stores an allocated block inside this memory_block_cache.
bool contains(const void *ptr) const noexcept
Evaluates whether ptr exists within this memory_block_cache.
void steal_block(memory_block_cache &other) noexcept
Acquires an entry from another cache.
const memory_block & peek() const noexcept
Views the front memory block of this cache.
owner< memory_block > request_block() noexcept
Requests a block from the current block cache.
memory_block_cache() noexcept
Default constructs a block cache.
bool empty() const noexcept
Returns whether or not this memory_block_cache is empty.
void swap(memory_block_cache &other) noexcept
Swaps this with another block cache.
A cache containing an intrinsically linked list of memory_blocks.
std::size_t size_bytes() const noexcept
Returns the size in bytes of all the memory_blocks in the cache.
std::size_t size() const noexcept
Returns the number of memory_blocks in this cache.
Wrapper around a block of memory, containing both the size and the address of the memory block...