zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: read -q broken on OSX / BSD?
Date: Mon, 7 Jan 2013 21:19:48 +0000	[thread overview]
Message-ID: <20130107211948.31185367@pws-pc.ntlworld.com> (raw)
In-Reply-To: <130107080416.ZM3398@torch.brasslantern.com>

On Mon, 07 Jan 2013 08:04:16 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jan 7,  9:47am, Peter Stephenson wrote:
> }
> } Now I look, if we're going to tinker like that, the zfree(buf, bptr -
> } buf + 1) becomes a bit dodgy, too.
> 
> Is there really any case where the size passed to zfree matters?  IIRC
> in the heap code we're passing only the size of the header structure,
> not the size of the actual allocated block.

It's an optimisation for the internal allocation mechanism; it starts
searching at the size you give, but if it doesn't find it it starts
again from size zero.  So the worst case is if you give a size that's
too large, otherwise it's at least as good as specifying the size as
zero, which is equivalent to not specifying it.

How much time this saves is now lost in the midst of time.

Anyway, it doesn't look like it needs changing in this case.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2013-01-08  1:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06  9:06 Yaniv Aknin
2013-01-06 18:43 ` Bart Schaefer
2013-01-06 18:47 ` Peter Stephenson
2013-01-06 22:13   ` Bart Schaefer
2013-01-07  9:47     ` Peter Stephenson
2013-01-07 16:04       ` Bart Schaefer
2013-01-07 21:19         ` Peter Stephenson [this message]

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=20130107211948.31185367@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).