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

Function sh_grow

src/pipeline/pass_shell.c:83–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81static const char SH_ROOT[] = "\x01";
82
83static bool sh_grow(void **items, int *cap, int count, size_t elem) {
84 if (count < *cap) {
85 return true;
86 }
87 int ncap = *cap ? *cap * PAIR_LEN : SH_GROW_MIN;
88 void *grown = cbm_realloc(CBM_MEM_CLASS_OTHER, *items, (size_t)ncap * elem);
89 if (!grown) {
90 return false;
91 }
92 *items = grown;
93 *cap = ncap;
94 return true;
95}
96
97static const char *sh_basename(const char *p) {
98 const char *s = strrchr(p, '/');

Callers 11

sh_paths_pushFunction · 0.85
sh_targets_pushFunction · 0.85
sh_setFunction · 0.85
sh_touch_addFunction · 0.85
sh_hit_pushFunction · 0.85
sh_kubectl_addFunction · 0.85
sh_chdirFunction · 0.85
mk_split_linesFunction · 0.85
mk_closure_fileFunction · 0.85
sh_sourceFunction · 0.85
sh_linkFunction · 0.85

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected