From owner-freebsd-current Mon Sep 3 1:47:58 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 6AA1837B406 for ; Mon, 3 Sep 2001 01:47:53 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA10982; Mon, 3 Sep 2001 18:47:37 +1000 Date: Mon, 3 Sep 2001 18:47:22 +1000 (EST) From: Bruce Evans X-X-Sender: To: Alfred Perlstein Cc: John Polstra , , Subject: Re: MALLOC/FREE macro useage. In-Reply-To: <20010902211606.I81307@elvis.mu.org> Message-ID: <20010903183414.X6804-100000@alphplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 2 Sep 2001, Alfred Perlstein wrote: > * John Polstra [010902 20:23] wrote: > > In article , > > Gersh wrote: > > > sys/malloc.h says that the macro versions of MALLOC/FREE are > > > deprecated however they are used all over the place. I belive that they > > > are cluttering and dont really have a purpose. Does anybody else agree? Yes (I wrote the line that says they are deprecated). > > > If I were to make up a patch for current removing all of them would > > > anybody care enough to commit it (Or care enough to not have it commited) No. > > Please don't. It would just create a bunch of new gratuitous > > differences against the other BSDs. At least in old code. > The reason for the macro is that when the size paramter is a constant > there's an evil trick that makes selecting the malloc bucket really > cheap. That's not the reason. The size parameter is not constant since MALLOC() just calls malloc(). I wouldn't call the big conditional statement in BUCKETINDX() an evil trick. But perhaps it should be replaced by fls(). A builtin fls() could handle constants just as well. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message