From owner-freebsd-arch Thu Feb 6 11:38:17 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C19A137B405 for ; Thu, 6 Feb 2003 11:38:15 -0800 (PST) Received: from web41205.mail.yahoo.com (web41205.mail.yahoo.com [66.218.93.38]) by mx1.FreeBSD.org (Postfix) with SMTP id 4EA5B43FA3 for ; Thu, 6 Feb 2003 11:38:15 -0800 (PST) (envelope-from gathorpe79@yahoo.com) Message-ID: <20030206193815.71344.qmail@web41205.mail.yahoo.com> Received: from [149.99.118.238] by web41205.mail.yahoo.com via HTTP; Thu, 06 Feb 2003 14:38:15 EST Date: Thu, 6 Feb 2003 14:38:15 -0500 (EST) From: Gary Thorpe Subject: Re: New kernel allocation API To: Jeff Roberson , Julian Elischer Cc: Peter Wemm , Dag-Erling Smorgrav , arch@FreeBSD.ORG In-Reply-To: <20030206040110.V79483-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --- Jeff Roberson wrote: > On Wed, 5 Feb 2003, Julian Elischer wrote: > > > > > I know several consumers where the size is not known or would be > > expensive to calculate on free. > > > > I bet there are 10x as many that do: > > foo = malloc(sizeof(*foo)); > > Which could just as easily do: > > free(foo, sizeof(*foo)); > > Optimize for the common case. It will make the allocator MUCH > faster. > > Cheers, > Jeff > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message How will it make it faster? By jumping to the group of memory slabs that would match that size? Its too bad it cannot directly find the slab by using the pointer value....how does free() search for the allocated block? Also, with more arguments, the programmer can make more mistakes. What happens if the wrong size is passed to free? It should still work, but it will be slower right? ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message