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

Function cand_push

internal/cbm/doc_pdf.c:291–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289} candv_t;
290
291static bool cand_push(candv_t *cv, cand_t c) {
292 if (cv->fail) {
293 return false;
294 }
295 if (cv->n == cv->cap) {
296 int ncap = cv->cap ? cv->cap * 2 : PDF_LIST_MIN;
297 cand_t *g = (cand_t *)cbm_realloc(CBM_MEM_CLASS_EXTRACT, cv->v, (size_t)ncap * sizeof(*g));
298 if (!g) {
299 cv->fail = true;
300 return false;
301 }
302 cv->v = g;
303 cv->cap = ncap;
304 }
305 cv->v[cv->n++] = c;
306 return true;
307}
308
309static void candv_free(candv_t *cv) {
310 cbm_free(CBM_MEM_CLASS_EXTRACT, cv->v);

Callers 3

path_candidateFunction · 0.85
qual_candidateFunction · 0.85
tok_candidateFunction · 0.85

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected