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

Function cbm_doclink_test_fail_alloc

internal/cbm/doclink.c:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24bool cbm_doclink_test_fail_alloc(int kind) {
25 if (kind < 0 || kind >= CBM_DOCLINK_ALLOC_KINDS) {
26 return false;
27 }
28 int n = atomic_load(&doc_alloc_fail_after[kind]);
29 while (n > 0) {
30 if (atomic_compare_exchange_weak(&doc_alloc_fail_after[kind], &n, n - 1)) {
31 return n == 1;
32 }
33 }
34 return false;
35}
36
37void cbm_doclink_test_reset_alloc(void) {
38 for (int i = 0; i < CBM_DOCLINK_ALLOC_KINDS; i++) {

Callers 7

cbm_doclinks_pushFunction · 0.85
cs_clean_valueFunction · 0.85
doc_push_spanFunction · 0.85
doc_run_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected