Commit cf4c7f2 for gzip
commit cf4c7f2d69abc58a2912de19dd17d2f096f80bd0
Author: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu Nov 12 18:23:07 2026 -0800
gzip: ignore -DSMALL_MEM, -DMEDIUM_MEM
This continues the cleanout of old 16-bit code.
There is no reason to limit these array sizes nowadays.
* deflate.c (window_size): Now const. It was actually const
before, despite its comment, which is now removed.
diff --git a/deflate.c b/deflate.c
index 5db492d..ef51e1c 100644
--- a/deflate.c
+++ b/deflate.c
@@ -84,20 +84,6 @@
* Configuration parameters
*/
-/* Compile with MEDIUM_MEM to reduce the memory requirements or
- * with SMALL_MEM to use as little memory as possible. Use BIG_MEM if the
- * entire input file can be held in memory (not possible on 16 bit systems).
- * Warning: defining these symbols affects HASH_BITS (see below) and thus
- * affects the compression ratio. The compressed output
- * is still correct, and might even be smaller in some cases.
- */
-
-#ifdef SMALL_MEM
-# define HASH_BITS 13 /* Number of bits used to hash strings */
-#endif
-#ifdef MEDIUM_MEM
-# define HASH_BITS 14
-#endif
#ifndef HASH_BITS
# define HASH_BITS 15
/* For portability to 16 bit machines, do not use values above 15. */
@@ -151,8 +137,6 @@ typedef unsigned IPos;
* WSIZE-MAX_MATCH bytes, but this ensures that IO is always
* performed with a length multiple of the block size. Also, it limits
* the window size to 64K, which is quite useful on MSDOS.
- * To do: limit the window size to WSIZE+BSZ if SMALL_MEM (the code would
- * be less efficient).
*/
/* DECLARE(Pos, prev, WSIZE); */
@@ -164,9 +148,8 @@ typedef unsigned IPos;
/* DECLARE(Pos, head, 1<<HASH_BITS); */
/* Heads of the hash chains or NIL. */
-static ulg window_size = (ulg)2*WSIZE;
-/* window size, 2*WSIZE except for MMAP or BIG_MEM, where it is the
- * input file length plus MIN_LOOKAHEAD.
+static ulg const window_size = 2 * WSIZE;
+/* window size, always 2*WSIZE.
*/
long block_start;
@@ -540,8 +523,6 @@ fill_window ()
/* By the IN assertion, the window is not empty so we can't confuse
* more == 0 with more == 64K on a 16 bit machine.
*/
- Assert(window_size == (ulg)2*WSIZE, "no sliding with BIG_MEM");
-
memcpy((char*)window, (char*)window+WSIZE, (unsigned)WSIZE);
match_start -= WSIZE;
strstart -= WSIZE; /* we now have strstart >= MAX_DIST: */
diff --git a/gzip.h b/gzip.h
index fd497e6..5d15594 100644
--- a/gzip.h
+++ b/gzip.h
@@ -70,29 +70,17 @@ extern int method; /* compression method */
*/
#ifndef INBUFSIZ
-# ifdef SMALL_MEM
-# define INBUFSIZ 0x2000 /* input buffer size */
-# else
# define INBUFSIZ 0x40000 /* input buffer size */
-# endif
#endif
#define INBUF_EXTRA 64 /* required by unlzw() */
#ifndef OUTBUFSIZ
-# ifdef SMALL_MEM
-# define OUTBUFSIZ 8192 /* output buffer size */
-# else
# define OUTBUFSIZ 0x40000 /* output buffer size */
-# endif
#endif
#define OUTBUF_EXTRA 2048 /* required by unlzw() */
#ifndef DIST_BUFSIZE
-# ifdef SMALL_MEM
-# define DIST_BUFSIZE 0x2000 /* buffer for distances, see trees.c */
-# else
# define DIST_BUFSIZE 0x8000 /* buffer for distances, see trees.c */
-# endif
#endif
#define EXTERN(type, array) extern type array[]
diff --git a/trees.c b/trees.c
index 10c79a8..9c27a0e 100644
--- a/trees.c
+++ b/trees.c
@@ -116,15 +116,7 @@ static int extra_blbits[BL_CODES] /* extra bits for each bit length code */
/* The three kinds of block type */
#ifndef LIT_BUFSIZE
-# ifdef SMALL_MEM
-# define LIT_BUFSIZE 0x2000
-# else
-# ifdef MEDIUM_MEM
-# define LIT_BUFSIZE 0x4000
-# else
# define LIT_BUFSIZE 0x8000
-# endif
-# endif
#endif
#ifndef DIST_BUFSIZE
# define DIST_BUFSIZE LIT_BUFSIZE