


In which case, liblz4 no longer includes, and requires instead that functions LZ4_malloc(), LZ4_calloc() and LZ4_free() are implemented somewhere in the project, and then available at link time. It used to require a small direct modification of lz4.c source code, but can now be achieved by using the build macro LZ4_USER_MEMORY_FUNCTIONS at compilation time.

This is now firmly controlled, documented and tested.įinally, replacing memory functions ( malloc(), calloc(), free()), typically for freestanding environments, is now a bit easier. This function used to require the exact compressed size, and would sometimes support above scenario "by accident", but then could also break it by accident. Even the "fast" variant receives some gains (albeit very small).Īlso, the corresponding decompression function, LZ4_decompress_safe_partial(), officially supports a scenario where the input (compressed) size is unknown (but bounded), as long as the requested amount of data to regenerate is smaller or equal to the block's content. The high compression variant LZ4_compress_HC_destSize() would miss some important opportunities in highly compressible data, resulting in less than optimal compression (detected by This is fixed in this version. Other notable updatesĪmong the visible fixes, this version improves the _destSize() variant, an advanced API which reverses the logic by targeting an a-priori compressed size and trying to shove as much data as possible into the target budget. For example, on my laptop, compared with v1.9.2, this version built with VS2019 compresses at 640 MB/s (from 420 MB/s), and decompression reaches 3.75 GB/s (from 3.3 GB/s). It is also expected to better support a broader range of VS variants. On the build side, multiple rounds of improvements, thanks to contributors such as and make this version generate faster binaries for Visual Studio. Existing liblz4 API is not modified, so it should be a drop-in replacement. LZ4 v1.9.3 is a maintenance release, offering more than 200+ commits to fix multiple corner cases and build scenarios.
