summaryrefslogtreecommitdiff
path: root/infback.c
AgeCommit message (Collapse)Author
2021-06-04Use SET_BAD macro in inflateBack.Nathan Moinvaziri
2020-10-09Fixed left shift ubsan warning in PULLBYTE.Nathan Moinvaziri
infback.c:200:13: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' 624: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/zlib-ng/zlib-ng/infback.c:200:13 in
2020-08-31Rename ZEXPORT and ZEXTERN for consistency.Nathan Moinvaziri
2020-08-23Reintroduce support for ZLIB_CONST in compat mode. (#704)Mika Lindqvist
* Reintroduce support for ZLIB_CONST in compat mode.
2020-07-10Fixed chunksize not being initialized when using inflateBack.Nathan Moinvaziri
2020-06-09Use standard int types in zlib-ng api.Nathan Moinvaziri
2020-02-07Fixed formatting, 4 spaces for code intent, 2 spaces for preprocessor ↵Nathan Moinvaziri
indent, initial function brace on the same line as definition, removed extraneous spaces and new lines.
2019-08-08Remove syntax, whitespace and comment differences between inflate.cHans Kristian Rosbach
and infback.c, making actual differences much easier to spot, easing maintenance.
2019-08-06Deduplicate inflate's fixedtables(), and no longer inline the inffixed tables.Hans Kristian Rosbach
This also reduces the library size by 4120bytes or ~2.9%.
2019-08-06Deduplicate common inflate/inflatefast/inflateBack macros into inflate_p.hHans Kristian Rosbach
2019-07-18Add zng_ prefix to internal functions to avoid linking conflicts with zlib. ↵Nathan Moinvaziri
(#363)
2018-12-18bug #117: speed up inflate_fastSebastian Pop
Based on a patch by Nigel Tao: https://github.com/madler/zlib/pull/292/commits/e0ff1f330cc03ee04843f857869b4036593ab39d This patch makes unzipping of files up to 1.2x faster on x86_64. The other part (1.3x speedup) of the patch by Nigel Tao is unsafe as discussed in the review of that pull request. zlib-ng already has a different way to optimize the memcpy for that missing part. The original patch was enabled only on little-endian machines. This patch adapts the loading of 64 bits at a time to big endian machines. Benchmarking notes from Hans Kristian Rosbach: https://github.com/zlib-ng/zlib-ng/pull/224#issuecomment-444837182 Benchmark runs: 7, tested levels: 0-7, testfile 100M develop at 796ad10 with -O3: Level Comp Comptime min/avg/max Decomptime min/avg/max 0 100.02% 0.01/0.01/0.02 0.08/0.09/0.11 1 47.08% 0.49/0.50/0.51 0.37/0.39/0.40 2 36.02% 1.10/1.12/1.13 0.39/0.39/0.40 3 34.77% 1.32/1.34/1.37 0.38/0.38/0.38 4 33.41% 1.50/1.53/1.56 0.37/0.37/0.38 5 33.07% 1.85/1.87/1.90 0.36/0.37/0.38 6 32.83% 2.54/2.57/2.61 0.36/0.37/0.38 avg 45.31% 1.28 0.34 tot 62.60 16.58 PR224 with -O3: Level Comp Comptime min/avg/max Decomptime min/avg/max 0 100.02% 0.01/0.01/0.02 0.09/0.09/0.10 1 47.08% 0.49/0.50/0.51 0.37/0.37/0.38 2 36.02% 1.09/1.11/1.13 0.38/0.38/0.39 3 34.77% 1.32/1.34/1.38 0.35/0.36/0.38 4 33.41% 1.49/1.52/1.54 0.36/0.36/0.37 5 33.07% 1.85/1.88/1.93 0.35/0.36/0.37 6 32.83% 2.55/2.58/2.65 0.35/0.35/0.36 avg 45.31% 1.28 0.33 tot 62.48 16.02 So I see about a 5.4% speedup on my x86_64 machine, not quite the 1.2x speedup but a nice speedup nevertheless. This benchmark measures the total execution time of minigzip, so that might have caused some inefficiencies. At -O2, I only see a 2.7% speedup.
2018-03-22Move private defines from zconf.h and zconf-ng.h to zbuild.hMika Lindqvist
* move definition of z_size_t to zbuild.h
2018-01-31Adapt code to support PREFIX macros and update build scriptsMika Lindqvist
2018-01-31Add function prefix (zng_) to all exported functions to allow zlib-ngHans Kristian Rosbach
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.
2017-02-16Type cleanup...Mika Lindqvist
* uInt -> unsigned int * ulg -> unsigned long
2017-02-09zlib 1.2.9Mark Adler
2017-01-31Clean up type conversions.Mark Adler
Based on upstream 7096424f23df1b1813237fb5f8bc8f34cfcedd0c, but modified heavily to match zlib-ng.
2017-01-31Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.Mika Lindqvist
2017-01-30local -> staticMika Lindqvist
* local -> static * Normalize and cleanup line-endings * Fix warnings under Visual Studio. * Whitespace cleanup *** This patch has been edited to merge cleanly and to exclude type changes. Based on 8d7a7c3b82c6e38734bd504dac800b148ab410d0 "Type Cleanup"
2015-12-14Type cleanup.Mika Lindqvist
2015-06-05Revert "Replace 'unsigned long' with most suitable fixed-size type."Hans Kristian Rosbach
This commit was cherry-picked and was not done, resulting in a few problems with gcc on 64bit windows. This reverts commit edd7a72e056b994458ff040d4740b16b35336b60. Conflicts: arch/x86/crc_folding.c arch/x86/fill_window_sse.c deflate.c deflate.h match.c trees.c
2015-05-25Style cleanup for inflate codeHans Kristian Rosbach
2015-05-23Replace 'unsigned long' with most suitable fixed-size type.Mika Lindqvist
2015-05-22Replace (void *)0 with NULL.Mika Lindqvist
2015-05-22Replace unsigned short with uint16_tHans Kristian Rosbach
Conflicts: inflate.h inftrees.c inftrees.h match.c
2015-05-13z_const -> constDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: arch/x86/crc_folding.c crc32.c
2015-05-12Convert remaining K&R function declarations to ANSI-C declarations.Hans Kristian Rosbach
2015-05-12Remove support for compiling with Z_SOLO.Hans Kristian Rosbach
Make compiling without gzip file operation support the default (define WITH_GZFILEOP or use --zlib-compat to enable them). Add initial support for compiling in a zlib-compatible mode, this currently only enables gzip file operations and sets the ZLIB_COMPAT flag. Conflicts: test/minigzip.c
2015-04-26Cleanup: Replace 'z_streamp' with 'z_stream *'Hans Kristian Rosbach
2015-04-26Cleanup: Replace 'voidp' with 'void *'Hans Kristian Rosbach
2015-04-26Use memcpy, memcmp and memzero directlyHans Kristian Rosbach
2014-10-18Rewrite K&R-style function prototypes to ANSI-C-style.hansr
Only internal functions, no exported functions in this commit.
2014-10-18Remove FAR variants of voidpfhansr
And a few Bytef leftovers from test/example.c
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 2)hansr
-Removing usage of OF() definition
2014-10-09Remove FAR definitionhansr
Remove a few leftovers from the legacy OS support removal
2012-08-13Clean up the usage of z_const and respect const usage within zlib.Mark Adler
This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment.
2011-12-18zlib 1.2.5.2Mark Adler
2011-11-27Remove code from inflate.c and infback.c that is impossible to execute.Mark Adler
During coverage testing it was discovered that these two lines could never pull more bits, since the immediately preceding for loop assures that all of the code's bits are already pulled.
2011-10-07Add a ./config --solo option to make zlib subset with no libary useMark Adler
A common request has been the ability to compile zlib to require no other libraries. This --solo option provides that ability. The price is that the gz*, compress*, and uncompress functions are eliminated, and that the user must provide memory allocation and free routines to deflate and inflate when initializing.
2011-09-09zlib 1.2.3.5Mark Adler
2011-09-09zlib 1.2.3.4Mark Adler
2011-09-09zlib 1.2.3.3Mark Adler
2011-09-09zlib 1.2.2.4Mark Adler
2011-09-09zlib 1.2.2.2Mark Adler
2011-09-09zlib 1.2.2.1Mark Adler
2011-09-09zlib 1.2.2Mark Adler
2011-09-09zlib 1.2.1.2Mark Adler
2011-09-09zlib 1.2.0.5Mark Adler
2011-09-09zlib 1.2.0.4Mark Adler