MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / py_param_stack_reserve

Function py_param_stack_reserve

internal/cbm/extract_unified.c:195–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195static bool py_param_stack_reserve(WalkState *state) {
196 if (state->py_param_stack_count < state->py_param_stack_capacity) {
197 return true;
198 }
199 int new_capacity = state->py_param_stack_capacity * PAIR_LEN;
200 if (new_capacity <= state->py_param_stack_capacity) {
201 return false;
202 }
203 const char **grown =
204 (const char **)cbm_arena_alloc(state->arena, (size_t)new_capacity * sizeof(*grown));
205 if (!grown) {
206 return false;
207 }
208 memcpy(grown, state->py_param_stack, (size_t)state->py_param_stack_count * sizeof(*grown));
209 state->py_param_stack = grown;
210 state->py_param_stack_capacity = new_capacity;
211 return true;
212}
213
214/* Bind one parameter name for the lifetime of the frame currently on top. */
215static void py_param_bind(WalkState *state, const char *name) {

Callers 1

py_param_bindFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected