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

Function ConstructImpl

util/memory/tempbuf.cpp:183–189  ·  view source on GitHub ↗

* all magick is here: * if len <= TMP_BUF_LEN. then we get prealloced per threaded buffer * else allocate one in heap */

Source from the content-addressed store, hash-verified

181 * else allocate one in heap
182 */
183static inline TTempBuf::TImpl* ConstructImpl(size_t len) {
184 if (len <= TMP_BUF_LEN) {
185 return AcquireSmallBuffer(len);
186 }
187
188 return new (len) TAllocedBuf();
189}
190
191TTempBuf::TTempBuf(size_t len)
192 : Impl_(ConstructImpl(len))

Callers 1

TTempBufMethod · 0.85

Calls 1

AcquireSmallBufferFunction · 0.85

Tested by

no test coverage detected