alloc_aligned when using in C++ requires C++17 standard. zutil_p.h
include removed from test_crc32 since it was causing the same issue and was
not really needed.
Changes since 2.1.0-Beta1:
- Fix missing exported z_size_t type in zlib.h (zlib-compat mode).
- Fix two Coverity warnings
- Fix CMake GNUInstallDirs usage
- Configure/CMake improvements for compilers with early AVX512-VNNI support (GCC8.0 etc)
- Microptimalization for AVX512 implementation of CRC32
- Optimized deflate_rle compression, also added related test and benchmark.
- Add testing of file_compress/file_uncompress in minigzip/minideflate
- Add emulated RISC-V to CI test workflow
- Add deflate_fast to switchlevels test
- Fix abicheck CI test was not ignoring version string
- Fix MinGW CI test, broken by Github Actions VM image updates
This release contains two years of development and improvements to zlib-ng,
as well as fixes and changes inherited from zlib.
The 2.1.x version series has new targeted minumum buildsystem versions, as detailed on the Wiki https://github.com/zlib-ng/zlib-ng/wiki
Buildsystem:
- Many improvements to the CMake scripts.
- Improved support for detecting memory alignment functions.
- Improved support for unaligned access by letting the compiler promote code to unaligned if supported by the CPU.
- Remove x86 cpu feature detection for TZCNT, safely fallback to BSF.
- Enable using AVX512 intrinsics with GCC <9.
Optimizations and Enhancements:
- Decompression is a lot faster (56% faster measured on AVX2-capable x86-64)
- Compresson is improved for Level 9, at the cost of a little performance.
- Compression is improved for Level 3, by switching from deflate_fast to deflate_medium.
- Levels 3 and 4 have been reconfigured to provide a better gradual tradeoff for speed/compression between levels 2 and 5.
- Deflate_quick (Level 1) has been improved to default to a bigger windowsize and support changing the window size like the other levels.
New instruction set optimizations:
- Adler32 implementation using AVX512, AVX512-VNNI, VMX.
- CRC32-B implementation using VPCLMULQDQ & IBM-Z.
- Slide hash implementation using VMX.
- Compare256 implementations using SSE2, Neon, & POWER9.
- Inflate chunk copying using SSSE3 & VSX.
Compatibility and Porting:
- CRC-32 computation changes from madler/zlib. zlib-ng/zlib-ng#a6155234
- Compatible and up-to-date with zlib 1.2.13.
- Removed the usage of macros in zlib-ng.h, making life easier for languages that want to call the C functions without having the C preprocessor (Python, etc).
Improved support more environments:
- Apple M1
- vcpkg
- Emscripten
Testing:
- Tests have been converted to use GTest. Many new tests have also been added.
- Gbench support has been added to easily benchmark changes to performance-critical functions.
Misc:
- Several pieces of core code has been restructured or rewritten.
- Too many changes to list here, see the git commit log for the full list of changes.
Deprecations:
- Configure no longer has the full range of tests.
- NMake is no longer actively supported and tested, it is now community supported.
- See the wiki for minimum build system versions and deprecations https://github.com/zlib-ng/zlib-ng/wiki
zutil.c: In function ‘zng_calloc_aligned’:
zutil.c:133:20: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]
Replace ZLIBNG_VERNUM with a larger one with space for more accurate information.
Replace ZLIBNG_VER_SUBREVISION with ZLIBNG_VER_MODIFIED and ZLIBNG_VER_STATUS.
- Include porting guide in release packages #917
- Documentation improvements #913#949
- Added Windows ARM binaries in release packages #916
- Fix crash on ARMv7 #927
- Fix building on FreeBSD #921
- Fix building with musl on aarch64 #936#952
- Fix ARM float-abi detection #918
- Fix cmake detection of risc-v architectures #942
- Minor buildsystem fixes#922#924#933#938#950
- Improve zlib-compat build #915#944
- CI/Test improvements #926#929#927#937#939#940
Make new static functions zng_alloc and zng_free available to other parts of the code.
Always request aligned allocations, even if UNALIGNED_OK is set.
to co-exist in an application that has been linked to something that
depends on stock zlib. Previously, that would cause random problems
since there is no way to guarantee what zlib version is being used
for each dynamically linked function.
Add the corresponding zlib-ng.h.
Tests, example and minigzip will not compile before they have been
adapted to use the correct functions as well.
Either duplicate them, so we have minigzip-ng.c for example, or add
compile-time detection in the source code.