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

Function ap_json_malloc

src/store/architecture_projection.c:39–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37} ap_json_budget;
38
39static void *ap_json_malloc(void *context, size_t size) {
40 ap_json_budget *budget = context;
41 if (size > AP_JSON_BUDGET - budget->allocated) {
42 budget->failed = true;
43 return NULL;
44 }
45 void *p = cbm_alloc(CBM_MEM_CLASS_OTHER, size);
46 if (p)
47 budget->allocated += size;
48 else
49 budget->failed = true;
50 return p;
51}
52
53static void *ap_json_realloc(void *context, void *ptr, size_t old_size, size_t size) {
54 ap_json_budget *budget = context;

Callers

nothing calls this directly

Calls 1

cbm_allocFunction · 0.85

Tested by

no test coverage detected