35 b.
ptr =
new char[size];
38 else if (size <= b.
dim)
44 char *new_ptr =
new char[size];
45 std::memcpy (new_ptr, b.
ptr, b.
dim);
69 b.
ptr =
new char[size];
72 else if (size <= b.
dim)
80 for (new_size = b.
dim; new_size < size; new_size *= 2)
83 char *new_ptr =
new char[new_size];
84 std::memcpy (new_ptr, b.
ptr, b.
dim);
96 std::bind (standard_dealloc, std::placeholders::_1)
104 b.
ptr = (
char *) malloc (size);
110 b.
ptr = (
char *) realloc (b.
ptr, size);
133 : m_alloc_f (alloc_f)
134 , m_dealloc_f (dealloc_f)
151 : m_base_allocator (base_alloc)
const block_allocator CSTYLE_BLOCK_ALLOCATOR
block_allocator m_allocator
void standard_alloc(block &b, size_t size)
std::function< void(block &b)> dealloc_func
~single_block_allocator()
const block_allocator STANDARD_BLOCK_ALLOCATOR
const block_allocator & m_base_allocator
void exponential_standard_alloc(block &b, size_t size)
block_allocator & operator=(const block_allocator &other)
std::function< void(block &b, size_t size)> alloc_func
void cstyle_dealloc(block &b)
void deallocate(block &b)
void standard_dealloc(block &b)
single_block_allocator(const block_allocator &base_alloc)
void allocate(block &b, size_t size)
const block_allocator EXPONENTIAL_STANDARD_BLOCK_ALLOCATOR
const block_allocator & get_block_allocator() const
void reserve(size_t size)
const block & get_block() const
void cstyle_alloc(block &b, size_t size)