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

Function get_decomp_buf

internal/cbm/ac.c:258–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256static CBM_TLS int tls_decomp_cap = 0;
257
258static char *get_decomp_buf(int needed) {
259 if (needed > tls_decomp_cap) {
260 free(tls_decomp_buf);
261 // Round up to 64KB chunks for reuse.
262 int cap = (needed + DECOMP_BUF_ALIGN_MASK) & ~DECOMP_BUF_ALIGN_MASK;
263 tls_decomp_buf = (cap > 0) ? (char *)malloc((size_t)cap) : NULL;
264 tls_decomp_cap = cap;
265 }
266 return tls_decomp_buf;
267}
268
269// cbm_ac_scan_lz4_bitmask decompresses LZ4 data into a thread-local buffer
270// and scans it through the AC automaton. Returns bitmask of matched patterns.

Callers 2

cbm_ac_scan_lz4_bitmaskFunction · 0.85
cbm_ac_scan_lz4_batchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected