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

Function py_ns_alloc

internal/cbm/extract_imports.c:361–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359#endif
360
361static void *py_ns_alloc(PyNamespaceBuilder *b, size_t size) {
362 if (b->failure)
363 return NULL;
364#ifdef CBM_ENABLE_TEST_SEAMS
365 if (py_namespace_capture_left == 0) {
366 b->failure = CBM_PY_NS_FAILURE_ALLOCATION;
367 return NULL;
368 }
369 if (py_namespace_capture_left > 0)
370 py_namespace_capture_left--;
371#endif
372 void *p = cbm_arena_alloc(b->ctx->arena, size);
373 if (!p)
374 b->failure = CBM_PY_NS_FAILURE_ALLOCATION;
375 return p;
376}
377
378static const char *py_ns_copy(PyNamespaceBuilder *b, const char *text, size_t len) {
379 if (len == SIZE_MAX) {

Callers 3

py_ns_copyFunction · 0.85
py_ns_pushFunction · 0.85
py_ns_all_literalFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected