Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2006 10:56:12 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        Jason Evans <jasone@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: Proposed addition of malloc_size_np()
Message-ID:  <20060325185612.GC7001@funkthat.com>
In-Reply-To: <4424FDE9.3080707@FreeBSD.org>
References:  <44247DF1.8000002@FreeBSD.org> <200603250806.k2P86YJU011861@apollo.backplane.com> <4424FDE9.3080707@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jason Evans wrote this message on Sat, Mar 25, 2006 at 00:23 -0800:
> have to store the precise allocation request size; it can instead round 
> the request size up internally, then treat the allocation as being of 
> this rounded up size.  By vaguely specifying the return value of 
> malloc_size_np(), we grant the malloc implementation freedom as to 
> whether the size is precisely what was specified during allocation, or 
> some rounded up value.
> 
> I had no intention of suggesting that malloc_size_np() should extend 
> existing allocations, nor change the return value depending on the 
> current state of memory following the allocation pointed to by ptr.

Ok, so what you are saying is that the function returns the size of
the bucket (if any) that the memory was allocated from...  But even
though this function may return a larger value, the program is not
allowed to use extra space, and it's only useful for further
allocations of the same size?

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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