aboutsummaryrefslogtreecommitdiff
path: root/FAQ
diff options
context:
space:
mode:
authorMark Adler <git@madler.net>2026-01-05 01:15:38 -0600
committerMark Adler <git@madler.net>2026-01-05 15:03:04 -0600
commitc267ef7306fe9fc1399833e3556cd9798dec2eb0 (patch)
treebc18574b8ea4fc37befdf0174fb5f04472911f6f /FAQ
parent916dc1ac351795c9bf86a3d19c3667b014b9d28e (diff)
downloadzlib-c267ef7306fe9fc1399833e3556cd9798dec2eb0.tar.gz
zlib-c267ef7306fe9fc1399833e3556cd9798dec2eb0.tar.bz2
zlib-c267ef7306fe9fc1399833e3556cd9798dec2eb0.zip
Use atomics to build inflate fixed tables once.
This moves the once code from crc32.c to zutil.c, and uses it also for building the inflate fixed tables when BUILDFIXED is defined. The fixed tables are now housed in inftrees.c, shared by inflate.c and infback.c. The once() function is now external, and so is renamed to z_once() to avoid name collisions. If either BUILDFIXED or DYNAMIC_CRC_TABLE is defined, and atomics are not available, then a warning is issued noting that zlib is not thread-safe.
Diffstat (limited to 'FAQ')
-rw-r--r--FAQ4
1 files changed, 4 insertions, 0 deletions
diff --git a/FAQ b/FAQ
index b6b11bd..57dd4f5 100644
--- a/FAQ
+++ b/FAQ
@@ -156,6 +156,10 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html
156 library memory allocation routines by default. zlib's *Init* functions 156 library memory allocation routines by default. zlib's *Init* functions
157 allow for the application to provide custom memory allocation routines. 157 allow for the application to provide custom memory allocation routines.
158 158
159 If the non-default BUILDFIXED or DYNAMIC_CRC_TABLE defines are used on a
160 system without atomics (e.g. pre-C11), then inflate() and crc32() will not
161 be thread safe.
162
159 Of course, you should only operate on any given zlib or gzip stream from a 163 Of course, you should only operate on any given zlib or gzip stream from a
160 single thread at a time. 164 single thread at a time.
161 165