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

Function ti_grow

src/mcp/test_impact_source.c:373–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371};
372
373static bool ti_grow(void **items, int *cap, int count, size_t size) {
374 if (count < *cap) {
375 return true;
376 }
377 int next = *cap ? *cap * 2 : 8;
378 void *grown = cbm_realloc(CBM_MEM_CLASS_EXTRACT, *items, (size_t)next * size);
379 if (!grown) {
380 return false;
381 }
382 *items = grown;
383 *cap = next;
384 return true;
385}
386
387static bool ti_ints_push(ti_ints_t *a, int v) {
388 if (!ti_grow((void **)&a->items, &a->cap, a->count, sizeof(*a->items))) {

Callers 6

ti_ints_pushFunction · 0.85
cbm_ti_source_addFunction · 0.85
ti_add_suffixesFunction · 0.85
ti_strs_add_uniqueFunction · 0.85
ti_read_macroFunction · 0.85
ti_note_occurrenceFunction · 0.85

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected