| 40 | |
| 41 | template<typename TGuard> |
| 42 | NDetails::TStack TStorage::GetStack(const TGuard& guard, const char* name) { |
| 43 | Y_ABORT_UNLESS(!IsEmpty()); // check before call |
| 44 | |
| 45 | void* newStack = nullptr; |
| 46 | if (!Full_.empty()) { |
| 47 | newStack = Full_.back(); |
| 48 | Full_.pop_back(); |
| 49 | } else { |
| 50 | Y_ASSERT(!Released_.empty()); |
| 51 | newStack = Released_.back(); |
| 52 | Released_.pop_back(); |
| 53 | } |
| 54 | |
| 55 | Y_ABORT_UNLESS(guard.CheckOverflow(newStack), "corrupted stack in pool"); |
| 56 | Y_ABORT_UNLESS(guard.CheckOverride(newStack, StackSize_), "corrupted stack in pool"); |
| 57 | |
| 58 | return NDetails::TStack{newStack, newStack, StackSize_, name}; |
| 59 | } |
| 60 | } |
nothing calls this directly
no test coverage detected