7 #include <boost/memory/memory_block.hpp> 13 namespace boost {
namespace memory {
20 throw std::bad_alloc();
29 auto result = malloc(size);
31 throw std::bad_alloc();
33 return { result, size };
44 return block.
address !=
nullptr;
bool owns(memory_block &block)
Checks if the block has been allocated with this allocator.
void deallocate(memory_block &block)
Deallocates memory block using free.
static mallocator * self_allocate()
Allocates an instance of mallocator on the heap.
An allocator backed by malloc and free system calls.
memory_block allocate(std::size_t size)
Allocates a memory_block using malloc.
Represents an allocated memory block.