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

Function dm_scan_cost

tests/test_doc_mentions.c:6083–6092  ·  view source on GitHub ↗

The cost of scanning `src` as C#: text positions, brace-stack entries and * modifier children visited, bytes taken from the scratch arena. false when the file has no scope. */

Source from the content-addressed store, hash-verified

6081 * modifier children visited, bytes taken from the scratch arena. false when the file has no scope.
6082 */
6083static bool dm_scan_cost(const char *src, uint64_t *steps, uint64_t *bytes) {
6084 cbm_doclink_cs_test_cost_reset();
6085 CBMFileResult *r = src ? dm_extract(src, CBM_LANG_CSHARP, "Cost.cs") : NULL;
6086 bool ok = r && r->doc_scope;
6087 cbm_doclink_cs_test_cost(steps, bytes);
6088 if (r) {
6089 cbm_free_result(r);
6090 }
6091 return ok;
6092}
6093
6094/* The scan's cost of an input twice as large, as a multiple of the smaller
6095 * one's: about 2 for a scan that is linear, 4 for a quadratic one. -1 when a

Callers 2

dm_cost_growthFunction · 0.85

Calls 4

dm_extractFunction · 0.85
cbm_doclink_cs_test_costFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected