diff options
| author | Mark Adler <git@madler.net> | 2026-01-05 01:15:38 -0600 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2026-01-05 15:03:04 -0600 |
| commit | c267ef7306fe9fc1399833e3556cd9798dec2eb0 (patch) | |
| tree | bc18574b8ea4fc37befdf0174fb5f04472911f6f /inftrees.h | |
| parent | 916dc1ac351795c9bf86a3d19c3667b014b9d28e (diff) | |
| download | zlib-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 'inftrees.h')
| -rw-r--r-- | inftrees.h | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -60,3 +60,5 @@ typedef enum { | |||
| 60 | int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, | 60 | int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, |
| 61 | unsigned codes, code FAR * FAR *table, | 61 | unsigned codes, code FAR * FAR *table, |
| 62 | unsigned FAR *bits, unsigned short FAR *work); | 62 | unsigned FAR *bits, unsigned short FAR *work); |
| 63 | struct inflate_state; | ||
| 64 | void ZLIB_INTERNAL inflate_fixed(struct inflate_state FAR *state); | ||
