"Jacques A. Vidrine" wrote:
> 
> > I doubt that you could measure any difference between
> >       if (foo) free(foo);
> > and   free(foo);
>
> Nevertheless, I tend to write it that way at times -- maybe because it
> seems so natural to me to ask `do I need to free this thing?' -- and
> that gets translated directly to code.

  I find that I still use the:

    if( foo )
        free( foo );

...syntax a large part of the time.  It's a habit developed before you
could trust the free() implementation on every platform to conform to
sanity.  It also prevents me from getting into the habit of using syntax
that will get me into trouble when programming in embedded environments
& kernels.  In any case, this style doesn't raise the "what the hell?"
flag the way a number of other things do.

Jack


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

Reply via email to