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

Function pod_index_push

internal/cbm/extract_defs.c:2558–2572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2556}
2557
2558static void pod_index_push(CBMArena *a, pod_index_t *ix, const pod_sec_t *sec) {
2559 if (ix->count == ix->cap) {
2560 int ncap = ix->cap ? ix->cap * DOC_SPAN_GROW : DOC_SPAN_INIT_CAP;
2561 pod_sec_t *grown = (pod_sec_t *)cbm_arena_alloc(a, (size_t)ncap * sizeof(pod_sec_t));
2562 if (!grown) {
2563 return;
2564 }
2565 if (ix->count > 0) {
2566 memcpy(grown, ix->items, (size_t)ix->count * sizeof(pod_sec_t));
2567 }
2568 ix->items = grown;
2569 ix->cap = ncap;
2570 }
2571 ix->items[ix->count++] = *sec;
2572}
2573
2574/* Index the named =head / =item sections of one POD block. */
2575static void pod_index_block(CBMExtractCtx *ctx, pod_index_t *ix, TSNode pod) {

Callers 1

pod_index_blockFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected