[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: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch |
Date: |
Wed, 10 Sep 2003 21:29:33 +0200 |
User-agent: |
KMail/1.5 |
Gary V. Vaughan wrote:
+/* Only free P if non-NULL. */
+
+void *
+xfree (void *p)
+{
+ if (p)
+ free (p);
+ return 0;
+}
The benefit of this function over free() itself is so small... Is it really
useful to put this function into nearly every GNU executable?
I'd have less objections if you would declare the function inline in the
header file, or drop the function and instead write
#define XFREE(Var) ((Var) ? (free (Var), NULL) : NULL)
Bruno
- [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Gary V. Vaughan, 2003/09/10
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch,
Bruno Haible <=
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Paul Eggert, 2003/09/11
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Paul Eggert, 2003/09/11
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Gary V. Vaughan, 2003/09/11
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Paul Eggert, 2003/09/12
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Jim Meyering, 2003/09/13
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Gary V. Vaughan, 2003/09/15
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Paul Eggert, 2003/09/15
- Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch, Gary V . Vaughan, 2003/09/16