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

Function gi_parse_storage

src/discover/gitignore_checked_parse.c:85–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static bool gi_parse_storage(gi_parse_t *parse) {
86 size_t count = parse->count;
87 if (count > (SIZE_MAX - sizeof(cbm_ignore_program_t)) / sizeof(gi_pattern_t)) {
88 return gi_fail(parse->guard, CBM_IGNORE_CHECKED_LIMIT, CBM_IGNORE_CAP_ARENA);
89 }
90 size_t bytes = sizeof(cbm_ignore_program_t) + count * sizeof(gi_pattern_t);
91 parse->program = gi_allocate(parse->guard, bytes, parse->fault == GI_FAULT_PROGRAM);
92 if (!parse->program || !gi_zero(parse->guard, parse->program, bytes)) {
93 return false;
94 }
95 parse->program->owner = parse->guard->owner;
96 parse->program->count = count;
97 parse->count = 0;
98 return true;
99}
100
101static cbm_ignore_checked_status_t gi_parse(cbm_ignore_checked_t *owner, const void *bytes,
102 size_t length,

Callers 1

gi_parseFunction · 0.85

Calls 3

gi_failFunction · 0.85
gi_allocateFunction · 0.85
gi_zeroFunction · 0.85

Tested by

no test coverage detected