From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23617 invoked from network); 12 Mar 2003 08:26:34 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Mar 2003 08:26:34 -0000 Received: (qmail 11079 invoked by alias); 12 Mar 2003 08:26:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18342 Received: (qmail 11070 invoked from network); 12 Mar 2003 08:26:26 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Mar 2003 08:26:26 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [212.125.75.4] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Mar 2003 8:26:26 -0000 Received: (qmail 18115 invoked from network); 12 Mar 2003 08:26:25 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-20.tower-1.messagelabs.com with SMTP; 12 Mar 2003 08:26:25 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id IAA20524; Wed, 12 Mar 2003 08:26:24 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h2C8UG820651; Wed, 12 Mar 2003 09:30:17 +0100 cc: Zsh workers X-VirusChecked: Checked In-reply-to: <87bs0hdzuw.fsf@ceramic.fifi.org> From: Oliver Kiddle References: <20030224184502.A9922@pcchazelas.free.fr> <1556.1047286700@finches.logica.co.uk> <20030310192526.GA15858@fysh.org> <16574.1047378921@finches.logica.co.uk> <87bs0hdzuw.fsf@ceramic.fifi.org> To: Philippe Troin Subject: Re: LC_NUMERIC=fr_FR and floating point arithmetics Date: Wed, 12 Mar 2003 09:30:16 +0100 Message-ID: <20649.1047457816@finches.logica.co.uk> Philippe Troin wrote: > > Aren't you leaking a copy of the current locale (via dupstring()) > every time? dupstring() calls zhalloc() to allocate memory instead of zalloc() (unlike ztrdup()). So the memory should be freed the next time popheap() is called (which I think is done for each command line). The comment at the top of mem.c is what I'm basing this on. So I've always assumed that zalloc should only be used for things which need to persist from one command to the next, where realloc() is needed or where a large chunk of memory is needed. Oliver