From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28705 invoked by alias); 8 Jan 2013 01:11:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30954 Received: (qmail 24764 invoked from network); 8 Jan 2013 01:11:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.174 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-proxyuser-ip:date:from:to:subject:message-id :in-reply-to:references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=jgau4VW4QwjnA+76EjAO+8DqC2dYaYoAYjU3gUNoNv4=; b=Z7VS2UbdkyhaiVzuuV7Vq0ONlsI8gc6d0iT+u8jXvsvk+EzqtkvCWp9faWOTnrrp0D YF6/CbKe3J+Qm4dhA2jza6wFax+fxAfQqru/8LarjbxHsj92fHzFBdKXZBPnkyUOgDco DSiqOmq+yecoq/NYEq428FZ7o+eueYnWpmDswDfueO7YhPUFzEl3LfFAc8xP70WjEQSM xaAFTFrLA9piSahl3u5lBDR3XMPfYxr59kK/q33VdRkC1YX6Ujs3bsnn6LKHkQbRkAjd p0gTqla2m+apzlOGxu+0KNVDPgTfj+rjbM0x5JpV2fjA13d6R94vVCX3esd+3psek1/Y m6UQ== X-Received: by 10.194.61.105 with SMTP id o9mr98371909wjr.8.1357593591720; Mon, 07 Jan 2013 13:19:51 -0800 (PST) X-ProxyUser-IP: 86.26.6.143 Date: Mon, 7 Jan 2013 21:19:48 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: read -q broken on OSX / BSD? Message-ID: <20130107211948.31185367@pws-pc.ntlworld.com> In-Reply-To: <130107080416.ZM3398@torch.brasslantern.com> References: <20130106184743.6325554b@pws-pc.ntlworld.com> <130106141307.ZM2510@torch.brasslantern.com> <20130107094740.66f559a9@pwslap01u.europe.root.pri> <130107080416.ZM3398@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkzlX6SakWs4xCShj64PS3vC1KuD59RGv2qRcho/h84G6eSOAkpG58uaSRVELlCTWu5KBAV On Mon, 07 Jan 2013 08:04:16 -0800 Bart Schaefer 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/