31 #ifndef BIT_MEMORY_ALLOCATORS_BUMP_DOWN_LIFO_ALLOCATOR_HPP 32 #define BIT_MEMORY_ALLOCATORS_BUMP_DOWN_LIFO_ALLOCATOR_HPP 34 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 36 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 38 #include "detail/named_allocator.hpp" 40 #include "../utilities/macros.hpp" 41 #include "../utilities/memory_block.hpp" 42 #include "../utilities/owner.hpp" 43 #include "../utilities/pointer_utilities.hpp" 47 #include <type_traits> 81 using max_alignment = std::integral_constant<std::size_t,256>;
124 std::size_t offset = 0 ) noexcept;
130 void deallocate( owner<void*> p, std::size_t size );
144 bool owns(
const void* p )
const noexcept;
167 using named_bump_down_lifo_allocator = detail::named_allocator<bump_down_lifo_allocator>;
172 #include "detail/bump_down_lifo_allocator.inl" allocator_info info() const noexcept
Gets the info about this allocator.
bump_down_lifo_allocator(memory_block block) noexcept
Constructs a linear_allocator.
bool owns(const void *p) const noexcept
Checks whether linear_allocator contains the pointer p.
void deallocate(owner< void *> p, std::size_t size)
Does nothing for linear_allocator. Use deallocate_all.
An allocator that allocates memory in contiguous memory by 'bumping' the head pointer to lower memory...
owner< void * > try_allocate(std::size_t size, std::size_t align, std::size_t offset=0) noexcept
Tries to allocate memory of size size, aligned to the boundary align, offset by offset.
void deallocate_all() noexcept
Deallocates everything from this allocator.
Wrapper around a block of memory, containing both the size and the address of the memory block...
This type is used to hold the generic information for a given allocator.