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

Function op_strs_push

src/pipeline/pass_operator.c:655–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653} op_strs_t;
654
655static void op_strs_push(op_strs_t *v, const char *s) {
656 if (v->count == v->cap) {
657 int cap = v->cap ? v->cap * PAIR_LEN : OP_GROW_MIN;
658 char **grown = cbm_realloc(CBM_MEM_CLASS_OTHER, v->items, (size_t)cap * sizeof(*grown));
659 if (!grown) {
660 return;
661 }
662 v->items = grown;
663 v->cap = cap;
664 }
665 char *copy = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, s);
666 if (copy) {
667 v->items[v->count++] = copy;
668 }
669}
670
671/* group -> the package directories that declare it (owned keys and lists);
672 * `seen` holds "group\x1fdir" (owned keys) so a repeat is one lookup. */

Callers 1

op_note_groupFunction · 0.85

Calls 2

cbm_reallocFunction · 0.85
cbm_mem_strdupFunction · 0.85

Tested by

no test coverage detected