From owner-freebsd-hackers Mon Dec 18 11: 1:41 2000 From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 18 11:01:39 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from tongue.purplefrog.com (tongue.purplefrog.com [63.209.2.84]) by hub.freebsd.org (Postfix) with ESMTP id B826337B404 for ; Mon, 18 Dec 2000 11:01:39 -0800 (PST) Received: from integratus.com (adsl-64-164-192-194.dsl.snfc21.pacbell.net [64.164.192.194]) by tongue.purplefrog.com (8.9.1/8.9.1) with SMTP id OAA30504; Mon, 18 Dec 2000 14:01:11 -0500 Message-ID: <3A3E6002.F68A78E1@integratus.com> Date: Mon, 18 Dec 2000 11:05:38 -0800 From: Jack Rusher X-Mailer: Mozilla 4.74 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "Jacques A. Vidrine" Cc: Warner Losh , hackers@FreeBSD.ORG Subject: Re: Why not another style thread? (was Re: cvs commit: src/lib/libc/gen getgrent.c) 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "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