Allocate a block of memory (size specified during construction of Allocator. */
| 133 | of Allocator. |
| 134 | */ |
| 135 | void * |
| 136 | alloc_void() |
| 137 | { |
| 138 | void *ptr = nullptr; |
| 139 | if (alignment) { |
| 140 | ptr = aligned_alloc(alignment, element_size); |
| 141 | } else { |
| 142 | ptr = malloc(element_size); |
| 143 | } |
| 144 | if (advice) { |
| 145 | madvise(ptr, element_size, advice); |
| 146 | } |
| 147 | return ptr; |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | Deallocate a block of memory allocated by the Allocator. |
no outgoing calls
no test coverage detected