65 Allocator() { no_debug_alloc = getenv(
"GLIBCXX_FORCE_NEW") ==
nullptr; }
67 explicit Allocator(
size_t block_size_) : block_size(block_size_) {
68 no_debug_alloc = getenv(
"GLIBCXX_FORCE_NEW") ==
nullptr;
72 for (list_block_t::iterator i = list_block.begin(); i != list_block.end(); ++i) {
73 ::operator
delete(*i);
77 void* allocate(
size_t size) {
81 const size_t aligned{(size + align_comp) & ~align_comp};
84 while (block_size < 8 * aligned) { block_size *= 2; }
85 start = (
char*)::operator
new(block_size, block_alignment);
86 end = start + block_size;
87 list_block.push_front(start);
92 res = (
char*)::operator
new(size);
93 list_block.push_front((
char*)res);
98 void deallocate(
void* ptr,
size_t size) {}
102 static constexpr size_t align_comp{63};
103 static constexpr std::align_val_t block_alignment{align_comp+1};
104 using list_block_t = std::forward_list<char*>;
105 list_block_t list_block;
108 size_t block_size{65536};