MCPcopy Create free account
hub / github.com/beefytech/Beef / Allocate

Method Allocate

BeefRT/gperftools/src/thread_cache.h:365–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365inline void* ThreadCache::Allocate(size_t size, size_t cl) {
366 ASSERT(size <= kMaxSize);
367 ASSERT(size == Static::sizemap()->ByteSizeForClass(cl));
368
369 FreeList* list = &list_[cl];
370 if (list->empty()) {
371 //Beefy::DebugTimeGuard suspendTimeGuard(10, "ThreadCache::Allocate");
372 return FetchFromCentralCache(cl, size);
373 }
374 size_ -= size;
375 return list->Pop();
376}
377
378inline void ThreadCache::Deallocate(void* ptr, size_t cl) {
379 FreeList* list = &list_[cl];

Callers 4

do_malloc_smallFunction · 0.45
do_memalignFunction · 0.45
BF_do_malloc_smallFunction · 0.45
BF_do_malloc_smallFunction · 0.45

Calls 3

ByteSizeForClassMethod · 0.45
emptyMethod · 0.45
PopMethod · 0.45

Tested by

no test coverage detected