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

Function gfb_concat

tests/test_test_impact_git.c:2295–2302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2293}
2294
2295static cbm_git_bytes_t gfb_concat(CBMArena *arena,cbm_git_bytes_t a,cbm_git_bytes_t b) {
2296 if(a.length>SIZE_MAX-b.length)return (cbm_git_bytes_t){NULL,0};
2297 size_t size=a.length+b.length;unsigned char *bytes=cbm_arena_alloc(arena,size?size:1);
2298 if(!bytes)return (cbm_git_bytes_t){NULL,0};
2299 if(a.length)memcpy(bytes,a.data,a.length);
2300 if(b.length)memcpy(bytes+a.length,b.data,b.length);
2301 return (cbm_git_bytes_t){bytes,size};
2302}
2303
2304static bool gfb_capture_error(cbm_git_bytes_t capture,size_t width,const char *const *oids,
2305 const size_t *sizes,size_t count,bool payload,

Callers 1

Calls 1

cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected