| 98 | void Clear() { stackTop_ = stack_; } |
| 99 | |
| 100 | void ShrinkToFit() { |
| 101 | if (Empty()) { |
| 102 | // If the stack is empty, completely deallocate the memory. |
| 103 | Allocator::Free(stack_); |
| 104 | stack_ = 0; |
| 105 | stackTop_ = 0; |
| 106 | stackEnd_ = 0; |
| 107 | } |
| 108 | else |
| 109 | Resize(GetSize()); |
| 110 | } |
| 111 | |
| 112 | // Optimization note: try to minimize the size of this function for force inline. |
| 113 | // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. |
no test coverage detected