Skip to contentSkip to conversation

2.5.70-bk11 zlib reduce deflate workspace by 128k

PATCH In review Jörn Engel 1 participant 2 messages Jun 6, 2003 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.70-bk11 zlib reduce deflate workspace by 128k

Hi Linus!

Free lunch time. There are currently no users in the kernel that use a memlevel >8, but we reserve space for 9. The patch saves 128k at no cost.

Jörn

Signature · 15 lines
The cost of changing business rules is much more expensive for software
than for a secretaty.
-- unknown

--- linux-2.5.70-bk11/include/linux/zconf.h~zlib_memlevel	2003-06-06 15:56:15.000000000 +0200
+++ linux-2.5.70-bk11/include/linux/zconf.h	2003-06-06 15:57:28.000000000 +0200
@@ -23,7 +23,7 @@
 
 /* Maximum value for memLevel in deflateInit2 */
 #ifndef MAX_MEM_LEVEL
-#  define MAX_MEM_LEVEL 9
+#  define MAX_MEM_LEVEL 8
 #endif
 
 /* Maximum value for windowBits in deflateInit2 and inflateInit2.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 5 lines · On Fri, 6 June 2003 17:00:43 +0200, [email protected] wrote:

Jörn Engel <[email protected]> (030606.160149,<[email protected]>):

Quoted 3 lines

Free lunch time. There are currently no users in the kernel that use a memlevel >8, but we reserve space for 9. The patch saves 128k at no cost.

Quoted 11 lines

Review

Quoted 5 lines

/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL

(quoted diff) +1 -1
-#  define MAX_MEM_LEVEL 9
+#  define MAX_MEM_LEVEL 8
 #endif

i like the direction this is going, but when making these kind of changes it would be even better if the reasoning would be noted in a short comment (eg. "/* no users of memlevel>8 in kernel; saves 128k RAM */"). That way the next person looking at that code would immediately know why that number was chosen.

Usually, you would be right. But in this case, the existing comments in zconf.h match the situation *after* my patch. Looks good to me.

Jörn

Signature · 3 lines
But this is not to say that the main benefit of Linux and other GPL
software is lower-cost. Control is the main benefit--cost is secondary.
-- Bruce Perens