/*
* Another zlib variant, https://github.com/zlib-ng/zlib-ng.
* It used to force window bits to 13 for fast compression level,
- * uses (64 + sizeof(void*)) additional space on all allocations
- * for alignment, 16-byte padding in one of window-sized buffers,
+ * used (64 + sizeof(void*)) additional space on all allocations
+ * for alignment and 16-byte padding in one of window-sized buffers,
+ * uses a single allocation with up to 200 bytes for alignment and
+ * internal pointers, 5/4 times more memory for the pending buffer,
* and 128K hash.
*/
}
ctx->allocated = 8192 + 16 + (1 << (wbits + 2))
- + 131072 + (1 << (memlevel + 8))
+ + 131072 + (5 << (memlevel + 6))
+ 4 * (64 + sizeof(void*));
ctx->zlib_ng = 1;
}