diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2024-02-04 13:10:44 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2024-02-04 18:51:14 -0800 |
commit | 037bca67fdf3a81996aea3662521c676f653dfc6 (patch) | |
tree | cdb37024da6883eafdf3744a0172d79983bf3eaa /examples/zran.h | |
parent | 6378d33478ea2d068960aa4e68cf9f11a5ffcfbe (diff) | |
download | zlib-037bca67fdf3a81996aea3662521c676f653dfc6.tar.gz zlib-037bca67fdf3a81996aea3662521c676f653dfc6.tar.bz2 zlib-037bca67fdf3a81996aea3662521c676f653dfc6.zip |
Allocate the dictionaries in examples/zran.c.
This reduces the memory needed for dictionaries, and avoids the
need to reallocate the index at the end to return unused memory.
Diffstat (limited to 'examples/zran.h')
-rw-r--r-- | examples/zran.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/zran.h b/examples/zran.h index 23fbd1f..de0646b 100644 --- a/examples/zran.h +++ b/examples/zran.h | |||
@@ -11,7 +11,8 @@ typedef struct point { | |||
11 | off_t out; // offset in uncompressed data | 11 | off_t out; // offset in uncompressed data |
12 | off_t in; // offset in compressed file of first full byte | 12 | off_t in; // offset in compressed file of first full byte |
13 | int bits; // 0, or number of bits (1-7) from byte at in-1 | 13 | int bits; // 0, or number of bits (1-7) from byte at in-1 |
14 | unsigned char window[32768]; // preceding 32K of uncompressed data | 14 | unsigned dict; // number of bytes in window to use as a dictionary |
15 | unsigned char *window; // preceding 32K (or less) of uncompressed data | ||
15 | } point_t; | 16 | } point_t; |
16 | 17 | ||
17 | // Access point list. | 18 | // Access point list. |