public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH] deflate inflate_dynamic too
Date: Mon, 07 May 2007 11:34:23 -0700	[thread overview]
Message-ID: <463F712F.90902@zytor.com> (raw)
In-Reply-To: <4632AF57.1070102@goop.org>

Jeremy Fitzhardinge wrote:
> inflate_dynamic() has piggy stack usage too, so heap allocate it too.
> I'm not sure it actually gets used, but it shows up large in "make
> checkstack".

It might be worth reverting some of the code back to the zlib original.
 The use of stack allocations here is actually a Linux divergence from
zlib (done by Linus), in order to reduce the number of dynamic allocations.

In general, the use of dynamic allocations is highly dangerous, because
any time you have dynamic allocations you have the choice of either
sleeping or failing, unless you have a pre-reserved memory pool.

	-hpa

  parent reply	other threads:[~2007-05-07 18:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-28  2:20 [PATCH] deflate inflate_dynamic too Jeremy Fitzhardinge
2007-04-28 16:22 ` Matt Mackall
2007-05-07 18:34 ` H. Peter Anvin [this message]
2007-05-07 20:29   ` Jeremy Fitzhardinge
2007-05-07 20:53     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=463F712F.90902@zytor.com \
    --to=hpa@zytor.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox