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

Function cv2_array

src/mcp/test_impact_coverage.c:715–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715static void *cv2_array(cv2_context_t *ctx, size_t count, size_t size) {
716 if (!count)
717 return NULL;
718 if (size && count > SIZE_MAX / size) {
719 cv2_fail(ctx, CBM_COVERAGE_PARSE_LIMIT);
720 return NULL;
721 }
722 size_t bytes = count * size;
723 if (bytes > ctx->limits->max_alloc_bytes - ctx->allocated) {
724 cv2_fail(ctx, CBM_COVERAGE_PARSE_LIMIT);
725 return NULL;
726 }
727 if (!cv2_poll(ctx))
728 return NULL;
729 ctx->allocated += bytes;
730 void *memory = cbm_arena_alloc(&ctx->arena, bytes);
731 if (!memory) {
732 cv2_fail(ctx, CBM_COVERAGE_PARSE_OOM);
733 return NULL;
734 }
735 return cv2_zero(ctx, memory, bytes) ? memory : NULL;
736}
737
738static char *cv2_string(cv2_context_t *ctx, cv2_span_t span) {
739 if (span.length == SIZE_MAX) {

Callers 5

cv2_stringFunction · 0.85
cv2_prepareFunction · 0.85
cv2_nameFunction · 0.85
cv2_test_idsFunction · 0.85
cv2_sort_testsFunction · 0.85

Calls 4

cv2_failFunction · 0.85
cv2_pollFunction · 0.85
cv2_zeroFunction · 0.85
cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected