| 19 | } |
| 20 | |
| 21 | void LinearAllocator::clear() { |
| 22 | if (_reserve->prev == _tail) { |
| 23 | freeChunk(_reserve); |
| 24 | } |
| 25 | while (_tail->prev != NULL) { |
| 26 | Chunk* current = _tail; |
| 27 | _tail = _tail->prev; |
| 28 | freeChunk(current); |
| 29 | } |
| 30 | _reserve = _tail; |
| 31 | _tail->offs = sizeof(Chunk); |
| 32 | _used_memory = _chunk_size; |
| 33 | } |
| 34 | |
| 35 | void* LinearAllocator::alloc(size_t size) { |
| 36 | Chunk* chunk = _tail; |
nothing calls this directly
no outgoing calls
no test coverage detected