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

Method Return

library/cpp/netliba/v6/ib_mem.cpp:104–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 void TIBMemPool::Return(TPtrArg<TIBMemSuperBlock> blk) {
105 TGuard<TMutex> gg(CacheLock);
106 Y_ASSERT(AtomicGet(blk->UseCount) == 0);
107 size_t sz = 1ull << blk->SzLog;
108 if (sz + AllocCacheSize > IB_MEM_POOL_SIZE) {
109 AllocCache.clear();
110 AllocCacheSize = 0;
111 }
112 {
113 TVector<TIntrusivePtr<TIBMemSuperBlock>>& cc = AllocCache[blk->SzLog];
114 cc.push_back(blk.Get());
115 AllocCacheSize += sz;
116 }
117 }
118
119 void* TIBMemPool::ThreadFunc(void* param) {
120 BindToSocket(0);

Callers 2

DecRefMethod · 0.45
add_token_to_machineMethod · 0.45

Calls 4

AtomicGetFunction · 0.50
clearMethod · 0.45
push_backMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected