Re: cbdataFree() in -HEAD ?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 13 Mar 2001 09:57:29 +0100

Interesting that x = (cbdataInternalFree(x), NULL) bombs out on IRIX. I
can only quess to the cause, and the more I look at it, the more it
smells a compiler bug..

Anyway, either of the proposed would do, but I think we should stick to
the same definition as used by safe_free:

#define cbdataFree(x) if (x) { cbdataInternalFree(x); (x) = NULL; }

The if (p) return; can then be removed from cbdataInternalFree, and we
should avoid both the bombing and have the already-freed case execute a
tiny bit faster...

/Henrik

Alex Rousskov wrote:
>
> On Tue, 13 Mar 2001, Adrian Chadd wrote:
>
> > do { cbdataInternalFree(var); (var) = NULL; } while (0)
> > Is this ok ?
>
> Will "{ cbdataInternalFree(var); (var) = NULL; }" do?
>
> Alex.
Received on Tue Mar 13 2001 - 01:55:14 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:13:37 MST