[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch

From: Gary V . Vaughan
Subject: Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch
Date: Thu, 11 Sep 2003 10:10:58 +0100

On Thursday, September 11, 2003, at 09:29  am, Paul Eggert wrote:
Here is an even better implementation for xfree (p).  It evaluates p
only once, and it makes xfree (p) an expression so that you can say
something like this:

   p = (xfree (p), NULL);

Cool! And we could make *that* a macro ala my other mail:

    #define DELETE(Var)         ((Var) = (xfree (Var), 0))

Plus, doing it your way saves all the fluff of adding a whole other
module :-)

+1 vote from me.

if you like.  Personally I prefer 'xfree' to 'XFREE', since xfree is
really a function, but this patch leaves 'XFREE' in for backwards


I suppose we could use Autoconf to test whether 'free (NULL)' works,
and optimize xfree in that case.  This would improve performance only
for native compiles, but that's an important special case.

2003-09-11  Paul Eggert  <address@hidden>

        * lib/xalloc.h: Include <stdlib.h>, to declare 'free'.
        (xfree): New function.
        (XFREE): Use it.
        * modules/xalloc: Depend on inline.

Where is inline?  I can guess what it does, but it's not in CVS...

  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____ / )= GNU Hacker http://www.gnu.org/software/libtool \' `& `(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]