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

Function cbm_alloc

src/foundation/mem_core.c:261–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259#endif
260
261void *cbm_alloc(cbm_mem_class_t cls, size_t bytes) {
262 MEMEV_HINT(cls);
263 void *block = CBM_BACKING_MALLOC(bytes ? bytes : CBM_ALLOC_ONE);
264 MEMEV_ALLOCATED(block, bytes, 0);
265 if (!block) {
266 return NULL;
267 }
268 class_add(cls, charge_size(block, bytes), CBM_ALLOC_ONE);
269 return block;
270}
271
272void *cbm_calloc(cbm_mem_class_t cls, size_t bytes) {
273 MEMEV_HINT(cls);

Callers 15

cr_scratch_getFunction · 0.85
scan_pageFunction · 0.85
cbm_line_offsetsFunction · 0.85
cbm_mark_def_variantsFunction · 0.85
cbm_enclosing_callablesFunction · 0.85

Calls 2

class_addFunction · 0.85
charge_sizeFunction · 0.85

Tested by 13

te_read_fileFunction · 0.68
cbm_ti_source_newFunction · 0.68
ti_split_linesFunction · 0.68
ti_note_occurrenceFunction · 0.68
cbm_ti_graph_newFunction · 0.68
ts_headerFunction · 0.68
cbm_ti_seedFunction · 0.68
ta_yy_mallocFunction · 0.68
ta_feed_fileFunction · 0.68
cbm_ti_receipt_readFunction · 0.68
te_source_indexFunction · 0.68