From 8ef6098a65edc1a8656a3f737a0434dff503c328 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Tue, 30 Jan 2024 09:15:06 -0800 Subject: [PATCH] Enable LIT_MEM by default expect when WITH_REDUCED_MEM is ON. --- CMakeLists.txt | 2 +- configure | 2 +- deflate.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b0f5fcd..0d4659f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -537,7 +537,7 @@ endif() # Enable reduced memory configuration # if(WITH_REDUCED_MEM) - add_definitions(-DHASH_SIZE=32768u -DGZBUFSIZE=8192) + add_definitions(-DHASH_SIZE=32768u -DGZBUFSIZE=8192 -DNO_LIT_MEM) message(STATUS "Configured for reduced memory environment") endif() diff --git a/configure b/configure index 93090bab..04b5f580 100755 --- a/configure +++ b/configure @@ -858,7 +858,7 @@ fi # enable reduced memory configuration if test $reducedmem -eq 1; then echo "Configuring for reduced memory environment." | tee -a configure.log - CFLAGS="${CFLAGS} -DHASH_SIZE=32768u -DGZBUFSIZE=8192" + CFLAGS="${CFLAGS} -DHASH_SIZE=32768u -DGZBUFSIZE=8192 -DNO_LIT_MEM" fi # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X diff --git a/deflate.h b/deflate.h index 392cf117..f49ea06b 100644 --- a/deflate.h +++ b/deflate.h @@ -24,7 +24,9 @@ /* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at the cost of a larger memory footprint */ -/* #define LIT_MEM */ +#ifndef NO_LIT_MEM +# define LIT_MEM +#endif /* =========================================================================== * Internal compression state. -- 2.47.2