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

Function rs_block_push

internal/cbm/doclink_rs.c:3200–3217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3198/* ── Scope scan: items ───────────────────────────────────────────── */
3199
3200static void rs_block_push(rs_scan_t *s, TSNode node, int mod) {
3201 if (ts_node_is_null(node) || s->failed) {
3202 return;
3203 }
3204 if (s->nblocks >= s->blocks_cap) {
3205 int ncap = s->blocks_cap ? s->blocks_cap * PAIR_LEN : RS_SCAN_INIT;
3206 rs_block_t *grown = (rs_block_t *)rs_tmp_alloc(s, (size_t)ncap * sizeof(rs_block_t));
3207 if (!grown) {
3208 return;
3209 }
3210 if (s->nblocks > 0) {
3211 memcpy(grown, s->blocks, (size_t)s->nblocks * sizeof(rs_block_t));
3212 }
3213 s->blocks = grown;
3214 s->blocks_cap = ncap;
3215 }
3216 s->blocks[s->nblocks++] = (rs_block_t){.node = node, .mod = mod};
3217}
3218
3219/* The first fields of a T record: T mod start end flags kind name, then the
3220 * tab before the node field. */

Callers 3

rs_item_modFunction · 0.85
rs_scan_itemFunction · 0.85

Calls 1

rs_tmp_allocFunction · 0.85

Tested by

no test coverage detected