Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 2003 14:38:15 -0500 (EST)
From:      Gary Thorpe <gathorpe79@yahoo.com>
To:        Jeff Roberson <jroberson@chesapeake.net>, Julian Elischer <julian@elischer.org>
Cc:        Peter Wemm <peter@wemm.org>, Dag-Erling Smorgrav <des@ofug.org>, arch@FreeBSD.ORG
Subject:   Re: New kernel allocation API 
Message-ID:  <20030206193815.71344.qmail@web41205.mail.yahoo.com>
In-Reply-To: <20030206040110.V79483-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
 --- Jeff Roberson <jroberson@chesapeake.net> 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




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