| 256 | static CBM_TLS int tls_decomp_cap = 0; |
| 257 | |
| 258 | static 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. |
no outgoing calls
no test coverage detected