MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / clear

Method clear

src/linearAllocator.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void 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
35void* LinearAllocator::alloc(size_t size) {
36 Chunk* chunk = _tail;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected