On Sun, 17 Dec 2000, Chris Costello wrote:

> On Sunday, December 17, 2000, Jacques A. Vidrine wrote:
> > What do folks think about
> > 
> >   1)    if (data)
> >                 free(data);
> > 
> > versus
> > 
> >   2)    free(data);
> > 
> > versus
> > 
> >   3)    #define xfree(x) if ((x) != NULL) free(x);
> >         xfree(data);
> 
>    2.  The C standard dictates that free() does nothing when it
> gets a NULL argument.  The other two are just extra clutter.

        Agreed. However, in the kernel, all free()s should be made as in (1),
  in my opinion. (2) is dangerous, and (3) would just obfuscate the code.
  (I know this does not apply to the commit, but should be noted)

> -- 
> +-------------------+-------------------------------------------------+
> | Chris Costello    | This system will self-destruct in five minutes. |
> | [EMAIL PROTECTED] |                                                 |
> +-------------------+-------------------------------------------------+

  Later,
  Bosko Milekic
  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to