From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "H. Peter Anvin" <hpa@zytor.com>
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 13:29:22 -0700 [thread overview]
Message-ID: <463F8C22.40902@goop.org> (raw)
In-Reply-To: <463F712F.90902@zytor.com>
H. Peter Anvin wrote:
> 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.
>
Well, every time this code is instantiated, it gets its own malloc/free
definitions, so they can decide how to handle the dynamic allocations.
Seems better than assuming that every caller will have enough stack
space. If you want to approximate that, it would be easy enough to have
a stack-like malloc/free, in which freeing the last allocation will
always release space.
J
next prev parent reply other threads:[~2007-05-07 20:29 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
2007-05-07 20:29 ` Jeremy Fitzhardinge [this message]
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=463F8C22.40902@goop.org \
--to=jeremy@goop.org \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--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