@brief Pre-allocate storage for at least @p new_capacity elements. */
| 190 | |
| 191 | |
| 192 | /** @brief Pre-allocate storage for at least @p new_capacity elements. */ |
| 193 | bool stack_reserve(Stack* stk, size_t new_capacity) { |
| 194 | STACK_LOG("[stack_reserve]: stk=%p cap=%zu", (void*)stk, new_capacity); |
| 195 | |
| 196 | if (!stk || !stk->vec) { |
| 197 | return false; |
| 198 | } |
| 199 | if (!vector_reserve(stk->vec, new_capacity)) { |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 |
nothing calls this directly
no test coverage detected