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

Function cbm_requalify_push

internal/cbm/cbm.c:2148–2161  ·  view source on GitHub ↗

Record that `from` now names `to`, allocating room for one rule per expanded * def (`cap`) on first use; an allocation failure only skips the move. */

Source from the content-addressed store, hash-verified

2146/* Record that `from` now names `to`, allocating room for one rule per expanded
2147 * def (`cap`) on first use; an allocation failure only skips the move. */
2148static void cbm_requalify_push(cbm_requalify_rule_t **rules, int *n, int cap, const char *from,
2149 const char *to, bool raw_wins) {
2150 if (!from || !to || strcmp(from, to) == 0 || *n >= cap) {
2151 return;
2152 }
2153 if (!*rules) {
2154 *rules = (cbm_requalify_rule_t *)cbm_calloc(CBM_MEM_CLASS_EXTRACT,
2155 (size_t)cap * sizeof(cbm_requalify_rule_t));
2156 if (!*rules) {
2157 return;
2158 }
2159 }
2160 (*rules)[(*n)++] = (cbm_requalify_rule_t){from, to, raw_wins};
2161}
2162
2163/* True when raw def `r` and the remapped expanded def `d` are one definition's
2164 * site: same label and name, starting on the same original line. */

Callers 1

extract_file_ex_bodyFunction · 0.85

Calls 1

cbm_callocFunction · 0.85

Tested by

no test coverage detected