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

Function tr_push_nested

src/pipeline/doc_links_ts.c:179–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179static void tr_push_nested(tr_index_t *ix, tr_file_t *f, const char *name, uint32_t line,
180 uint32_t first, uint32_t last) {
181 if (f->nnested == 0 ||
182 (f->nnested >= CBM_SZ_4 && (f->nnested & (f->nnested - SKIP_ONE)) == 0)) {
183 int ncap = f->nnested ? f->nnested * PAIR_LEN : CBM_SZ_4;
184 tr_nest_t *g = (tr_nest_t *)cbm_arena_alloc(&ix->arena, (size_t)ncap * sizeof(tr_nest_t));
185 if (!g) {
186 ix->oom = true;
187 return;
188 }
189 if (f->nnested) {
190 memcpy(g, f->nested, (size_t)f->nnested * sizeof(tr_nest_t));
191 }
192 f->nested = g;
193 }
194 f->nested[f->nnested++] = (tr_nest_t){name, line, first, last};
195}
196
197static void tr_read_record(tr_index_t *ix, tr_file_t *f, const char **fl, const size_t *ln, int n) {
198 char tag = fl[0][0];

Callers 1

tr_read_recordFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected