Pavel P [Tue, 24 Mar 2020 03:25:08 +0000 (09:25 +0600)]
Avoid unnecessary include of windows.h from zbuild.h
zbuild.h is included from every .c file of zlib-ng, which forces every translation unit to parse all windows system includes only to be able to typedef ssize_t. This change removes windows.h include from zbuild.h and ssize_t is instead defined in-line with equivalent defines from windows.h
Reduce size of 'match' struct to 8 bytes, this allows us to fit two
structs into a single cacheline, resulting in a measurable speedup
in deflate_medium.
Fixed compressBound calculation for quick deflate strategy. Worse case is 9 bits per literal plus the size of headers and footers for block and gzip format. Works out to the size of the input plus additional 13.67%.
Don't enable debug when building with code coverage.
Don't disable optimization when building with code coverage.
Make sure GCC links with gcov, like the docs says you should.
Added better aligned access support for put_short.
Renamed putShortMSB to put_short_msb and moved to deflate.h with the rest of the put functions.
Added put_uint32 and put_uint32_msb and replaced instances of put_byte with put_short or put_uint32.
Fixed formatting, 4 spaces for code intent, 2 spaces for preprocessor indent, initial function brace on the same line as definition, removed extraneous spaces and new lines.
Added gzip tests for all open modes and compression levels for more code coverage.
Added tests for gzip compress/uncompress for all open modes.
Added test data from Google snappy project and include copying info.
Mika Lindqvist [Mon, 25 Nov 2019 23:23:50 +0000 (01:23 +0200)]
Compatibility fix for crc32()
* Use "unsigned long" externally instead of "uint32_t" for crc
* Use "unsigned int" externally instead of "uint32_t" for len
Mark Adler [Thu, 3 Jan 2019 02:10:40 +0000 (18:10 -0800)]
Don't bother computing check value after successful inflateSync().
inflateSync() is used to skip invalid deflate data, which means
that the check value that was being computed is no longer useful.
This commit turns off the check value computation, and furthermore
allows a successful return if the compressed data terminated in a
graceful manner. This commit also fixes a bug in the case that
inflateSync() is used before a header is ever processed. In that
case, there is no knowledge of a trailer, so the remainder is
treated as raw.
Clean up LIKELY/UNLIKELY definitions, making them upper-case to improve visibility.
Add LIKELY_NULL hint.
Add PREFETCH_L1, PREFETCH_L2 and PREFETCH_RW for GCC, Clang, ICC and MSVC.
Added github actions yaml for cmake and configure.
Added cmake toolchain files for qemu powerpc, sparc64, and s390x.
Turn off shared libs for qemu and use static builds for qemu.
Fixed maintainer mode being overwriting when in CI by options parsing.
Set CI environment variable to enable Fuzzers by default.
Added support for code-coverage for all tests.
Reduce indirections used by send_bits and send_code.
Also simplify the debug tracing into the define instead
of using a separate static function.
x86_64 shows a small performance improvement.
travis.yml changes:
- Select minimal vm image instead of generic ('C'), reducing size and boot time.
- Windows needs 'C' image to not hang on booting
- Update from Xenial to Bionic for linux tests.
- ppc64 images don't have Bionic, set to Xenial
- ppc64 is having misc failures with Xenial tools, so use GCC-9 and Clang-6
- ppc64 cannot run MSAN
- Add another test for more complete testing across architectures.
- Enable fuzzers, msan and/or sanitizers most various tests.
- Disable ASAN leak detection on aarch64, since it crashes under qemu
- Reorder tests to be better grouped and running windows/macox tests lasts.
- Enable verbose messages from sanitizers
CmakeLists.txt changes:
- Enable warnings by default.
- Add MAINTAINER setting to cmake
- Enables extra warnings.
- Enables fuzzers.
- Add CI detection to cmake, currently auto-enables MAINTAINER mode.
- Add detection of several more sanitizer features.
- Test sanitizer features together, not just alone.
This also helps with their inter-dependencies.
Unify detection of ARM getauxval code availability.
We don't want to compile arch-specific code when WITH_OPTIM is not set,
and the current checks don't take that into account.
travis.yml changes:
- Add shorthand-variables for some of the long parameters often used
- Enable --warn in a couple configure tests that did not have it enabled.
- Make travis print out CMakeError.log or configure.log in after_failure.
- Reorder some cmake parameters to improve consistency
- Disable ccache. Downloading and uploading the cache archive is quite slow,
especially if travis is having network-connectivity issues.
Also ccache caches gcno (coverage) files, making the coverage data wrong
because it is being shared across builds, branches and PRs.
CmakeLists.txt changes:
- Enable -Wall by default in cmake.