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

Function cbm_timeout_cb

internal/cbm/cbm.c:631–643  ·  view source on GitHub ↗

tree-sitter's TSProgressCallback mandates a non-const TSParseState*; a const * parameter here would not match the opts.progress_callback assignment below. */ cppcheck-suppress constParameterCallback

Source from the content-addressed store, hash-verified

629 * parameter here would not match the opts.progress_callback assignment below. */
630// cppcheck-suppress constParameterCallback
631static bool cbm_timeout_cb(TSParseState *state) {
632 CBMParseBudget *budget = (CBMParseBudget *)state->payload;
633 uint64_t wall = now_ns();
634#ifdef CBM_ENABLE_TEST_SEAMS
635 wall += tl_parse_wall_seam_offset_ns;
636#endif
637 bool over =
638 cbm_thread_cpu_time_ns() > budget->cpu_deadline_ns || wall > budget->wall_ceiling_ns;
639 if (over) {
640 budget->tripped = true; /* so a NULL tree can name its real cause */
641 }
642 return over;
643}
644
645// --- Thread-local parser pool ---
646// TSParser is not thread-safe, but can be reused across files on the same thread.

Callers

nothing calls this directly

Calls 2

cbm_thread_cpu_time_nsFunction · 0.85
now_nsFunction · 0.70

Tested by

no test coverage detected