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

Function gic_replay

tests/test_gitignore_checked.c:454–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454static bool gic_replay(const cbm_ignore_checked_limits_t *limits, gic_replay_result *out) {
455 cbm_ignore_checked_t *owner = NULL;
456 if (!gic_open(&owner, limits))
457 return false;
458 const cbm_ignore_program_t *program[2] = {NULL, NULL};
459 cbm_ignore_checked_error_t error = {0};
460 cbm_ignore_checked_status_t status = CBM_IGNORE_CHECKED_OK;
461 bool ok = true;
462 size_t arena_after_parse = 0;
463 for (size_t step = 0; step < 7 && ok && status == CBM_IGNORE_CHECKED_OK; step++) {
464 cbm_ignore_checked_usage_t before, after;
465 ok = cbm_ignore_checked_usage(owner, &before);
466 if (!ok)
467 break;
468 ok = step < 2 ? gic_replay_parse(owner, step, &program[step], &status, &error)
469 : gic_replay_match(owner, program, step, &status, &error);
470 ok = ok && error.status == status && cbm_ignore_checked_usage(owner, &after);
471 if (!ok)
472 break;
473 if (step == 1)
474 arena_after_parse = after.arena_requested_bytes;
475 if (step >= 2)
476 ok = after.arena_requested_bytes == arena_after_parse;
477 if (status == CBM_IGNORE_CHECKED_LIMIT && error.cap == CBM_IGNORE_CAP_BYTES)
478 ok = ok && before.bytes_reserved == after.bytes_reserved;
479 }
480 out->status = status;
481 out->cap = error.cap;
482 ok = ok && cbm_ignore_checked_usage(owner, &out->usage);
483 if (status != CBM_IGNORE_CHECKED_OK)
484 ok = ok && gic_terminal(owner, program[0], status);
485 cbm_ignore_checked_free(owner);
486 return ok;
487}
488
489static bool gic_quota_pair(const gic_replay_result *full, cbm_ignore_cap_t cap) {
490 cbm_ignore_checked_limits_t limits = gic_limits();

Callers 2

gic_quota_pairFunction · 0.85

Calls 6

gic_openFunction · 0.85
cbm_ignore_checked_usageFunction · 0.85
gic_replay_parseFunction · 0.85
gic_replay_matchFunction · 0.85
gic_terminalFunction · 0.85
cbm_ignore_checked_freeFunction · 0.85

Tested by

no test coverage detected