MCPcopy Create free account
hub / github.com/catboost/catboost / FreeAllLargeBlockMem

Function FreeAllLargeBlockMem

library/cpp/lfalloc/lf_allocX64.h:494–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492
493#ifndef _MSC_VER
494static void FreeAllLargeBlockMem() {
495 for (auto& lbFreePtr : lbFreePtrs) {
496 for (int i = 0; i < LB_BUF_SIZE; ++i) {
497 void* p = lbFreePtr[i];
498 if (p == nullptr)
499 continue;
500 if (DoCas(&lbFreePtr[i], (void*)nullptr, p) == p) {
501 int pgCount = TLargeBlk::As(p)->Pages;
502 AtomicAdd(lbFreePageCount, -pgCount);
503 LargeBlockUnmap(p, pgCount);
504 }
505 }
506 }
507}
508#endif
509
510static void LargeBlockFree(void* p, ELFAllocCounter counter) {

Callers 1

LargeBlockFreeFunction · 0.85

Calls 3

LargeBlockUnmapFunction · 0.85
DoCasFunction · 0.70
AtomicAddFunction · 0.70

Tested by

no test coverage detected