MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / stack_reserve

Function stack_reserve

stack/stack.c:192–203  ·  view source on GitHub ↗

@brief Pre-allocate storage for at least @p new_capacity elements. */

Source from the content-addressed store, hash-verified

190
191
192/** @brief Pre-allocate storage for at least @p new_capacity elements. */
193bool 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

Callers

nothing calls this directly

Calls 1

vector_reserveFunction · 0.85

Tested by

no test coverage detected