MCPcopy Create free account
hub / github.com/cpputest/cpputest / alloc

Method alloc

src/CppUTest/SimpleStringInternalCache.cpp:204–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204char* SimpleStringInternalCache::alloc(size_t size)
205{
206 if (isCached(size)) {
207 if (hasFreeBlocksOfSize(size))
208 return reserveCachedBlockFrom(getCacheNodeFromSize(size))->memory_;
209 else
210 return allocateNewCacheBlockFrom(getCacheNodeFromSize(size))->memory_;
211 }
212
213 nonCachedAllocations_ = createSimpleStringMemoryBlock(size, nonCachedAllocations_);
214 return nonCachedAllocations_->memory_;
215}
216
217void SimpleStringInternalCache::dealloc(char* memory, size_t size)
218{

Callers 1

alloc_memoryMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected