summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-04-02 06:29:38 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-04-02 06:29:38 +0000
commita76a6add6dab80d57ade7dc709fa2fd8215b10e8 (patch)
tree99d2143aca9a3b9f5d235885eff62e562b95fde4 /sys/lib
parent32cd3cb1ee7546343ae6d4acd345cf06617b4916 (diff)
save 4k space for i386!
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libz/inftrees.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c
index 39a9dd400d2..b53c08f1629 100644
--- a/sys/lib/libz/inftrees.c
+++ b/sys/lib/libz/inftrees.c
@@ -6,7 +6,10 @@
#include "zutil.h"
#include "inftrees.h"
+#ifndef i386
char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler ";
+#endif
+
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -372,11 +375,19 @@ z_streamp z; /* for zfree function */
/* build fixed tables only once--keep them here */
local int fixed_built = 0;
#define FIXEDH 530 /* number of hufts used by fixed tables */
+#ifndef i386
local inflate_huft fixed_mem[FIXEDH];
local uInt fixed_bl;
local uInt fixed_bd;
local inflate_huft *fixed_tl;
local inflate_huft *fixed_td;
+#else
+local inflate_huft *fixed_mem = NULL;
+local uInt fixed_bl = 0;
+local uInt fixed_bd = 0;
+local inflate_huft *fixed_tl = NULL;
+local inflate_huft *fixed_td = NULL;
+#endif
local voidpf falloc(q, n, s)
@@ -384,6 +395,11 @@ voidpf q; /* opaque pointer */
uInt n; /* number of items */
uInt s; /* size of item */
{
+#ifdef i386
+ extern void *alloc(u_int);
+ if (fixed_mem == NULL)
+ fixed_mem = alloc (FIXEDH * sizeof(*fixed_mem));
+#endif
Assert(s == sizeof(inflate_huft) && n <= *(intf *)q,
"inflate_trees falloc overflow");
*(intf *)q -= n+s-s; /* s-s to avoid warning */