Re: [PATCH 2/9] arm: do not place huge encoder tables on stack when it is too small
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2015-06-24 07:10:16
Also in:
linux-clk
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2015-06-24 07:10:16
Also in:
linux-clk
On Tue, Jun 23, 2015 at 11:19 PM, Paul Osmialowski [off-list ref] wrote:
Since stack on Cortex-M3 is too small, we need configuration option to avoid using it for huge encoder tables of zlib. Signed-off-by: Paul Osmialowski <redacted>
--- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c@@ -75,9 +75,14 @@ int zlib_inflateInit2(z_streamp strm, int windowBits) Return state with length and distance decoding tables and index sizes set to fixed code decoding. This returns fixed tables from inffixed.h. */ +#ifdef CONFIG_ZLIB_INFLATE_STACK_SAVING +# include "inffixed.h" +#endif static void zlib_fixedtables(struct inflate_state *state) { +#ifndef CONFIG_ZLIB_INFLATE_STACK_SAVING # include "inffixed.h"
All variables in inffixed.h are "static const", so they are not on the stack anyway, and this patch shouldn't make a difference.
+#endif
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds