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

Function wd_stack_max

internal/cbm/extract_defs.c:6645–6654  ·  view source on GitHub ↗

Generous safety ceiling (frames), env-overridable via CBM_WALK_DEFS_MAX. Realistic files never approach this; it only bounds a pathological/adversarial file so extraction degrades to a warned skip rather than unbounded memory.

Source from the content-addressed store, hash-verified

6643// Realistic files never approach this; it only bounds a pathological/adversarial
6644// file so extraction degrades to a warned skip rather than unbounded memory.
6645static int wd_stack_max(void) {
6646 const char *e = getenv("CBM_WALK_DEFS_MAX");
6647 if (e) {
6648 int v = atoi(e);
6649 if (v > 0) {
6650 return v;
6651 }
6652 }
6653 return 8 * 1024 * 1024; // 8M frames (~320 MB) default
6654}
6655
6656static void wd_push(wd_stack_t *s, TSNode node, const char *enclosing_qn) {
6657 if (s->top >= s->cap) {

Callers 1

wd_pushFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected