Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: read -q broken on OSX / BSD?



On Mon, 07 Jan 2013 08:04:16 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author