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

Function cbm_arena_sprintf

internal/cbm/arena.c:79–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79char *cbm_arena_sprintf(CBMArena *a, const char *fmt, ...) {
80 // First pass: compute length
81 va_list args;
82 va_start(args, fmt);
83 int needed = vsnprintf(NULL, 0, fmt, args);
84 va_end(args);
85
86 if (needed < 0) {
87 return NULL;
88 }
89
90 char *dst = (char *)cbm_arena_alloc(a, (size_t)needed + SKIP_ONE);
91 if (!dst) {
92 return NULL;
93 }
94
95 va_start(args, fmt);
96 vsnprintf(dst, (size_t)needed + SKIP_ONE, fmt, args);
97 va_end(args);
98
99 return dst;
100}
101
102void cbm_arena_destroy(CBMArena *a) {
103 for (int i = 0; i < a->nblocks; i++) {

Callers 15

record_lexical_bindingFunction · 0.70
emit_py_aliased_importFunction · 0.70
emit_py_import_from_nameFunction · 0.70
emit_php_use_clauseFunction · 0.70
resolve_chained_selectorFunction · 0.70
extract_callee_nameFunction · 0.70

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected