Hans Kristian Rosbach
5b208676f8
Clean up memory allocation functions that are no longer used, and its tests.
...
Co-authored-by: Ilya Leoshkevich <iii@linux.ibm.com>
2024-05-28 16:35:13 +02:00
Vladislav Shchapov
153b9648ed
Remove obsolete TARGET_OS_MAC check
...
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2024-04-04 13:48:31 +02:00
Mark Adler
4fe59efbe0
zlib 1.3.1
...
madler/zlib#51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
2024-02-07 19:15:56 +01:00
Mark Adler
43300cc416
Add bounds checking to ERR_MSG() macro, used by zError().
...
madler/zlib#431a9b65eacab7efabf2230ba97ff426c0e07f9d
2024-02-07 19:15:56 +01:00
Dougall Johnson
6a74e9294f
Inflate: add fast-path for literals
2023-02-24 13:24:49 +01:00
Nathan Moinvaziri
fa9bfeddcf
Use named defines instead of hard coded numbers.
2023-02-18 20:30:55 +01:00
Hans Kristian Rosbach
cf5bb01da9
Fix prefixing for internal functions calloc/cfree
2023-02-09 01:54:19 +01:00
Nathan Moinvaziri
b047c7247f
Prefix shared functions to prevent symbol conflict when linking native api against compat api.
2023-01-09 15:10:11 +01:00
Nathan Moinvaziri
d43822b9a7
zlib 1.2.12
2022-06-13 15:58:03 +02:00
Hans Kristian Rosbach
28b029c726
Simplify version and struct size checking, and ensure we do it the same way everywhere.
2022-06-03 10:21:01 +02:00
Nathan Moinvaziri
24d1d8497e
Rename memory alignment functions because they handle custom allocator which is the first parameter so having calloc and cfree (c = custom) is confusing in the name.
2022-04-14 00:00:22 +02:00
Nathan Moinvaziri
a39e323a4d
Added memory alignment compensation functions for users who may be using custom allocators that don't align on the same boundary zlib-ng expects.
2022-03-15 18:32:15 +01:00
Nathan Moinvaziri
6d01d437fd
Move build basics to zbuild.h.
2022-01-29 17:03:22 +01:00
Nathan Moinvaziri
08c2a332da
Remove unused fdopen define for MSVC.
2022-01-25 12:11:18 +01:00
Nathan Moinvaziri
a5a0b40e17
Move cpu_feature includes out of zutil.h.
2022-01-23 16:39:48 +01:00
Nathan Moinvaziri
cf5fe97d0f
Fixed wrong alignment definition used when compiling with ClangCl.
2022-01-07 14:55:23 +01:00
Hans Kristian Rosbach
70f608c79c
Fix deflateBound and compressBound returning very small size estimates.
...
Remove workaround in switchlevels.c, so we do actual testing of this.
Use named defines instead of magic numbers where we can.
2021-12-20 14:49:27 +01:00
Ilya Leoshkevich
63e0002cba
IBM Z: Adjust compressBound() for DFLTCC
...
When DFLTCC was introduced, deflateBound() was adjusted, but
compressBound() was not, leading to compression failures when using
compressBound() + compress() with poorly compressible data.
2021-10-13 15:39:57 +02:00
Nathan Moinvaziri
d802e8900f
Move crc32 folding functions into functable.
2021-08-13 15:05:34 +02:00
Nathan Moinvaziri
db59b63676
Added CRC32_INITIAL_VALUE to prevent initial call to crc32 function.
2021-08-13 15:05:34 +02:00
Mika Lindqvist
77d4c8789e
PowerPC: Add initial support for AltiVec.
...
* Add detection of VMX instructions
2021-08-11 12:02:55 +02:00
Ilya Leoshkevich
0573840dd0
IBM Z: Add vectorized CRC32 implementation
...
While DFLTCC takes care of accelerating compression on level 1, other
levels can be sped up too by computing CRC32 using various vector
instructions.
Take the Linux kernel assembly code that does that - its original
author (Hendrik Brueckner) works for IBM at the time of writing and has
allowed reusing the code under the zlib license. Rewrite it in C for
better maintainability, but keep the original structure, variable names
and comments.
Update the documentation.
Add CI configurations.
2021-07-07 19:54:01 +02:00
cenobit
a575b0817c
Fixed missing enclosing parentheses for ZSWAP64 in zutil.h to avoid erroneous result in inffast.c.
2021-06-26 08:36:02 +02:00
Hans Kristian Rosbach
101653c020
Add support for Thread Local Storage to ensure consistency in functable.
2021-06-18 09:24:35 +02:00
Hans Kristian Rosbach
cf9127a231
Separate MIN_MATCH into STD_MIN_MATCH and WANT_MIN_MATCH
...
Rename MAX_MATCH to STD_MAX_MATCH
2021-06-13 20:55:01 +02:00
David Carlier
8b5630050a
OpenBSD build fix proposal
2021-05-27 12:35:51 +02:00
Nathan Moinvaziri
cf14b8e255
Remove unused F_OPEN preprocessor macro.
2020-09-20 21:55:48 +02:00
Hans Kristian Rosbach
ac457a0476
Improve malloc.h handling in zutil.h
2020-09-14 12:04:30 +02:00
Nathan Moinvaziri
7cffba4dd6
Rename ZLIB_INTERNAL to Z_INTERNAL for consistency.
2020-08-31 12:33:16 +02:00
Nathan Moinvaziri
b5a81501f2
Rename ZLIB_REGISTER to Z_REGISTER for consistency.
2020-08-31 12:33:16 +02:00
Nathan Moinvaziri
a540c3f963
Add optional support for thread local storage. ( #733 )
2020-08-23 09:59:38 +02:00
Mika Lindqvist
28e5e73f34
Reintroduce support for ZLIB_CONST in compat mode. ( #704 )
...
* Reintroduce support for ZLIB_CONST in compat mode.
2020-08-23 09:58:57 +02:00
Nathan Moinvaziri
d8aeacbfa2
Harmonize the CPU architecture preprocessor definitions.
2020-08-20 12:05:11 +02:00
Nathan Moinvaziri
d5d1f7e81b
Fixed extra symbols added to ABI when zlib-compat specified.
2020-08-02 18:32:25 +02:00
Nathan Moinvaziri
e1dbcc186a
Added ZLIB_REGISTER to disable register keyword for C++.
...
Co-authored-by: pps83 <pps83@users.noreply.github.com>
2020-06-28 23:01:17 +02:00
Nathan Moinvaziri
6dcc7bf815
For gzseek, gzoffset, gzopen, adler32_combine, crc32_combine and crc32_combine_gen, export 32-bit and 64-bit versions for zlib-compatible api and only 64-bit version (without 64 suffix) for zlib-ng native api.
2020-06-08 21:14:07 +02:00
Pavel P
6dfff29c01
Clean up windows defines, use _WIN32
...
+ replaced WIN32 with _WIN32
+ removed unused WINDOWS/_WINDOWS defines
+ no need to test for __MINGW__, as _WIN32 is also defined
2020-06-08 15:09:17 +02:00
Matheus Castanho
b81f4ee96d
Preparation for POWER optimizations
...
Add the scaffolding for future optimizations for POWER processors. Now
the build is capable of correctly detecting multiple processor
sub-architectures (ppc, ppc64 and ppc64le) and also if features
needed for the optimizations are available during build and runtime.
With these changes, adding a new optimized function for POWER should be
as simple as adding a new file under arch/power/, appending build
instructions to the build files and editing functable.c accordingly.
The UNALIGNED_OK flag is now also added by default for powerpc64le
targets.
2020-06-08 14:47:17 +02:00
Nathan Moinvaziri
c0dbcace5d
Use a constant to load adler-32 initial hash value.
2020-05-30 21:16:37 +02:00
Nathan Moinvaziri
9bdb74aa2d
Fixed compiler warning about inline already being defined when including zutil.h in C++ app.
2020-05-24 14:43:50 +02:00
Nathan Moinvaziri
e09d131b5a
Standardize fill_window implementations and abstract out slide_hash_neon for ARM.
2020-05-01 00:21:18 +02:00
Pavel P
762068fdc6
Remove cvs keywords
2020-03-17 15:26:47 +01:00
Nathan Moinvaziri
e0a711cdde
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.
2020-02-07 10:44:20 +01:00
Hans Kristian Rosbach
cf5959e119
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.
2019-10-22 09:56:34 +02:00
Hans Kristian Rosbach
e0480bc800
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.
2019-09-21 22:10:46 +02:00
Nathan Moinvaziri
ce0076688a
Changes to support compilation with MSVC ARM & ARM64 ( #386 )
...
* Merge aarch64 and arm cmake sections.
* Updated MSVC compiler support for ARM and ARM64.
* Moved detection for -mfpu=neon to where the flag is set to simplify add_intrinsics_option.
* Only add ${ACLEFLAG} on aarch64 if not WITH_NEON.
* Rename arch/x86/ctzl.h to fallback_builtins.h.
2019-09-04 08:35:23 +02:00
Nathan Moinvaziri
743def4c93
Rename #defines for consistency ( #378 )
2019-08-23 22:16:27 +02:00
T.Yamada
1606d1490c
Fixed GCC version for bswap intrinsics ( #385 )
...
Use gcc 4.8 for __builtin_bswap16
2019-08-21 09:17:22 +02:00
Nathan Moinvaziri
f06c71f981
Add zng_ prefix to internal functions to avoid linking conflicts with zlib. ( #363 )
2019-07-18 13:21:13 +02:00
Sebastian Pop
4a6a599e93
factor out code in arch/{arm,aarch64}
2019-03-21 11:24:14 +01:00