| 124 | IndexManager() : next_free_slot_(0), max_slot_count_(0) {} |
| 125 | |
| 126 | size_t ReserveSlots(size_t n) { |
| 127 | size_t result = next_free_slot_; |
| 128 | next_free_slot_ += n; |
| 129 | if (next_free_slot_ > max_slot_count_) { |
| 130 | max_slot_count_ = next_free_slot_; |
| 131 | } |
| 132 | return result; |
| 133 | } |
| 134 | |
| 135 | size_t ReleaseSlots(size_t n) { |
| 136 | next_free_slot_ -= n; |
no outgoing calls
no test coverage detected