MCPcopy Create free account
hub / github.com/Snapchat/Valdi / append

Method append

valdi/src/valdi/runtime/Utils/RefCountableAutoreleasePool.cpp:43–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void RefCountableAutoreleasePool::append(void* ptr) {
44 // If our append will cause a reallocation, but we have some free spots available
45 // at the beginning, shift the array and reset the index to avoid the allocation.
46 if (_entriesIndex > 0 && _entries.size() + 1 >= _entries.capacity()) {
47 _entries.erase(_entries.begin(), _entries.begin() + _entriesIndex);
48 _entriesIndex = 0;
49 }
50
51 _entries.emplace_back(ptr);
52}
53
54size_t RefCountableAutoreleasePool::backingArraySize() const {
55 return _entries.size();

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
capacityMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected