Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2000 11:05:38 -0800
From:      Jack Rusher <jar@integratus.com>
To:        "Jacques A. Vidrine" <n@nectar.com>
Cc:        Warner Losh <imp@village.org>, hackers@FreeBSD.ORG
Subject:   Re: Why not another style thread? (was Re: cvs commit: src/lib/libc/gen  getgrent.c)
Message-ID:  <3A3E6002.F68A78E1@integratus.com>
References:  <20001217170316.A63227@hamlet.nectar.com> <200012172110.eBHLAfU46563@freefall.freebsd.org> <20001217151509.A63051@hamlet.nectar.com> <20001217151735.D54486@holly.calldei.com> <20001217153129.B63080@hamlet.nectar.com> <20001217153656.F54486@holly.calldei.com> <20001217155648.C63080@hamlet.nectar.com> <20001217160442.H54486@holly.calldei.com> <20001217170316.A63227@hamlet.nectar.com> <200012180501.WAA87838@harmony.village.org> <20001218123108.A65143@hamlet.nectar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A3E6002.F68A78E1>