Commit graph

17 commits

Author SHA1 Message Date
Xin LI aea57ebcb1 zlib: use more memory for a small deflate speedup.
The LIT_MEM option uses slightly more memory (for base gzip(1),
about 16kiB; according to the author, about 6% for default deflate
settings) for a small speedup.

The performance gain is more noticeable for input data with higher
entropy and less significant for data that is highly compressible,
such as source code and logs.

MFC after:	1 month
2024-02-19 15:01:04 -08:00
Xin LI 6255c67c3d MFV: zlib 1.3.1.
MFC after:	1 week
2024-02-17 22:12:51 -08:00
Xin LI ef3a764bc5 MFV: zlib: examples: define functions as static ones. (PR #855)
MFC after:	3 days
2023-09-04 20:14:31 -07:00
Xin LI 4717628ed8 MFV: zlib 1.3
Relnotes:	yes
MFC after:	2 weeks
2023-08-19 23:06:49 -07:00
Xin LI e37bb444aa MFV: zlib 1.2.13.
Relnotes:	yes
MFC after:	3 days
2023-02-16 23:57:24 -08:00
John Baldwin 7550e242ab zlib crc32: Add prototypes for recently-added static functions.
This appeases -Wstrict-prototypes with GCC.  Using a separate
prototype using the OF macro seems to be consistent with the rest of
this file which still supports pre-ANSI C.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36755
2022-09-28 14:00:27 -07:00
Mark Adler 2969066f73 zlib: Fix extra field processing bug that dereferences NULL state->head.
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.

(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)
2022-08-08 14:19:27 -04:00
Mark Adler dc3509f1aa zlib: Fix a bug when getting a gzip header extra field with inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

(cherry picked from zlib commit eff308af425b67093bab25f80f1ae950166bece1)
2022-08-04 22:30:20 -04:00
Ed Maste ab5c7dff95 zlib: replace CRLF line endings in zlib.map
MFC after:	3 days
2022-04-04 15:10:03 -04:00
Xin LI 0a21252adf sys/contrib/zlib: Always define Z_U8 and Z_U4
This is a temporary hack for zlib to make sure that the library
still builds when building with Z_SOLO (used in kernel and loader),
as zlib is depending on limits.h which is only available in STDC
case.

PR:		kern/262977
MFC after:	3 days
2022-04-03 14:38:31 -07:00
Xin LI c61bc1110c MFV 7b495a2a7a (zlib): Correct incorrect inputs provided to the CRC
functions.

MFC after:	3 days
2022-03-31 15:35:58 -07:00
Xin LI cd8822075a MFV c144cc5479: zlib 1.2.12.
MFC after:	3 days
Relnotes:	yes
2022-03-31 07:25:53 -07:00
Jessica Clarke 6010a892b4 zlib: Fix bootstrap build on macOS
gzlib.c uses lseek but does not include unistd.h, where it is defined to
live. On FreeBSD this happens to work due to sys/types.h declaring it,
but on macOS it fails due to being only implicitly declared, which is
treated as an error by default by the system Clang.

MFC after:	1 week
2021-12-07 00:24:19 +00:00
Xin LI 110f229794 MFV r351500: Fix CLEAR_HASH macro to be usable as a single statement.
MFC after:	2 weeks
2019-08-26 00:46:39 +00:00
Xin LI a15cb219c6 Expose zlib's utility functions in Z_SOLO library when building kernel.
This allows kernel code to reuse zlib's implementation.

PR:		229763
Reviewed by:	Yoshihiro Ota <ota j email ne jp>
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D21156
2019-08-07 01:41:17 +00:00
Xin LI 0ed1d6fb00 Allow Kernel to link in both legacy libkern/zlib and new sys/contrib/zlib,
with an eventual goal to convert all legacl zlib callers to the new zlib
version:

 * Move generic zlib shims that are not specific to zlib 1.0.4 to
   sys/dev/zlib.
 * Connect new zlib (1.2.11) to the zlib kernel module, currently built
   with Z_SOLO.
 * Prefix the legacy zlib (1.0.4) with 'zlib104_' namespace.
 * Convert sys/opencrypto/cryptodeflate.c to use new zlib.
 * Remove bundled zlib 1.2.3 from ZFS and adapt it to new zlib and make
   it depend on the zlib module.
 * Fix Z_SOLO build of new zlib.

PR:		229763
Submitted by:	Yoshihiro Ota <ota j email ne jp>
Reviewed by:	markm (sys/dev/zlib/zlib_kmod.c)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D19706
2019-08-01 06:35:33 +00:00
Xin LI c9083b850a Move contrib/zlib to sys/contrib/zlib so that we can use it in kernel.
This is a prerequisite of unifying kernel zlib instances.

Submitted by:	Yoshihiro Ota <ota at j.email.ne.jp>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20191
2019-05-08 08:43:15 +00:00