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

Function GetAllocator

library/cpp/coroutine/engine/stack/stack_allocator.cpp:6–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace NCoro::NStack {
5
6 THolder<IAllocator> GetAllocator(TMaybe<TPoolAllocatorSettings> poolSettings, EGuard guardType) {
7 THolder<IAllocator> allocator;
8 if (poolSettings) {
9 if (guardType == EGuard::Canary) {
10 allocator = MakeHolder<TPoolAllocator<TCanaryGuard>>(*poolSettings);
11 } else {
12 Y_ASSERT(guardType == EGuard::Page);
13 allocator = MakeHolder<TPoolAllocator<TPageGuard>>(*poolSettings);
14 }
15 } else {
16 if (guardType == EGuard::Canary) {
17 allocator = MakeHolder<TSimpleAllocator<TCanaryGuard>>();
18 } else {
19 Y_ASSERT(guardType == EGuard::Page);
20 allocator = MakeHolder<TSimpleAllocator<TPageGuard>>();
21 }
22 }
23 return allocator;
24 }
25
26}

Calls

no outgoing calls

Tested by

no test coverage detected