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

Function gc_note_root

src/pipeline/pass_operator.c:1812–1831  ·  view source on GitHub ↗

Remember that root text `root` stood for directory `rdir`; two different * directories for one root text: it stands for none. */

Source from the content-addressed store, hash-verified

1810/* Remember that root text `root` stood for directory `rdir`; two different
1811 * directories for one root text: it stands for none. */
1812static void gc_note_root(CBMHashTable *roots, const char *root, const char *rdir) {
1813 const char *known = cbm_ht_get(roots, root);
1814 if (!known) {
1815 char *k = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, root);
1816 char *d = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, rdir);
1817 if (k && d) {
1818 cbm_ht_set(roots, k, d);
1819 return;
1820 }
1821 cbm_free(CBM_MEM_CLASS_OTHER, k);
1822 cbm_free(CBM_MEM_CLASS_OTHER, d);
1823 return;
1824 }
1825 if (strcmp(known, GC_CONFLICT) != 0 && strcmp(known, rdir) != 0) {
1826 char *c = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, GC_CONFLICT);
1827 if (c) {
1828 cbm_free(CBM_MEM_CLASS_OTHER, cbm_ht_set(roots, cbm_ht_get_key(roots, root), c));
1829 }
1830 }
1831}
1832
1833/* Link the chart loads: a tail exactly one chart directory ends with; else,
1834 * when the loads under the same unknown root (opt.ChartsDirectory) whose

Callers 1

gc_link_sitesFunction · 0.85

Calls 5

cbm_ht_getFunction · 0.85
cbm_mem_strdupFunction · 0.85
cbm_ht_setFunction · 0.85
cbm_freeFunction · 0.85
cbm_ht_get_keyFunction · 0.85

Tested by

no test coverage detected