outBuf.compressBlockFast
private fn
size_t compressBlockFast(const(ubyte) * src, size_t srcLen,
ubyte * outBuf, size_t outCap,
int level,
uint * ht = null,
size_t htSize = 0,
uint htBits = 0) @trusted @nogc nothrowCompress a single block using the fast pointer-based path.
This function performs LZO1X-style compression entirely with raw pointers and malloc/free, avoiding all GC allocations. It is marked @trusted @nogc nothrow so it can be called from performance-sensitive contexts.
The caller is responsible for providing a sufficiently large output buffer. A safe upper bound is srcLen + srcLen / 16 + 64.
When ht is supplied the caller owns the hash table and it is
memset.
When ht is null the function allocates and frees a hash table internally.
Parameters
src | Pointer to the uncompressed source data. |
srcLen | Number of bytes at src. |
outBuf | Pointer to the output buffer. |
outCap | Capacity of outBuf in bytes. |
level | Compression level (0-9). |
ht | Optional externally-owned hash table. If null, one is allocated and freed internally. |
htSize | Number of entries in the externally-owned hash table. Ignored when ht is null. |
htBits | Number of hash bits for the external table. Ignored when ht is null. |
Returns
The number of bytes written to
See Also
compressBlock