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

Method Allocate

util/memory/mmapalloc.cpp:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 class TMmapAllocator: public IAllocator {
9 public:
10 TBlock Allocate(size_t len) override {
11 TMappedAllocation m(len + sizeof(TMappedAllocation));
12 TMappedAllocation* real = (TMappedAllocation*)m.Data();
13
14 (new (real) TMappedAllocation(0))->swap(m);
15
16 TBlock ret = {real + 1, len};
17
18 return ret;
19 }
20
21 void Release(const TBlock& block) override {
22 TMappedAllocation tmp(0);

Callers

nothing calls this directly

Calls 2

DataMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected