Re: [PATCH] Fix memory function use
On Tuesday, 02 May 2006 at 22:36, Thomas Roessler wrote:
> On 2006-05-02 13:25:30 -0700, Brendan Cully wrote:
>
> > I don't see a good reason to deliberately use safe_free
> > instead of FREE at the moment (or vv). Is there one?
>
> One reason is that FREE just behaves like free, in that you
> don't need to put in the & operator. But that's about it.
The current definition appears to be:
# define FREE(x) safe_free(x)
> I don't feel particularly strongly either way, but do think the
> code should be consistent.
Ok, how about we use
# define FREE(x) safe_free(&(x))
and have check_sec look out for safe_free without
__SAFE_FREE_CHECKED__ ?
Updating FREE throughout the source might be a little annoying
though:
% grep 'FREE \?(' *.[ch] imap/*.[ch]|wc -l
592
% grep 'FREE \?(&' *.[ch] imap/*.[ch]|wc -l
543
% grep safe_free *.[ch] imap/*.[ch]|wc -l
14
-b