| 4 | namespace 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 | } |
no outgoing calls
no test coverage detected