Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2006 08:24:21 +0300
From:      Vasil Dimov <vd@FreeBSD.org>
To:        Jason Evans <jasone@FreeBSD.org>
Cc:        Robert Watson <rwatson@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: Proposed addition of malloc_size_np()
Message-ID:  <20060328052421.GA97222@qlovarnika.bg.datamax>
In-Reply-To: <44281421.3060401@FreeBSD.org>
References:  <44247DF1.8000002@FreeBSD.org> <20060326110929.V35431@fledge.watson.org> <4426D7A0.4040007@FreeBSD.org> <200603271110.02917.jhb@freebsd.org> <44281421.3060401@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Mon, Mar 27, 2006 at 08:34:41AM -0800, Jason Evans wrote:
[...]
> Following is what I've written for the malloc(3) man page:
> ----
> The malloc_usable_size() function returns the usable size of the 
> allocation pointed to by ptr.  The return value may be larger than the 
> size that was requested during allocation.  malloc_usable_size() is not 
> intended as a mechanism for in-place realloc(), though it can be abused 
> that way; rather it is primarily provided as a tool for introspection 
> purposes.  Any discrepancy between the requested allocation size and the 
> size reported by malloc_usable_size() should not be depended on, since 
> such behavior is entirely implementation-dependent.
> ----
Although this is obvious it should mention that the pointer passed must
have been returned by a malloc() or realloc() call or unpredictable
things will happen, right?

-- 
Vasil Dimov
gro.DSBeerF@dv

Testing can show the presence of bugs, but not their absence.
                -- Edsger W. Dijkstra

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iD8DBQFEKMiFFw6SP/bBpCARAkXJAJ4rJIhi37k9Q/to78mu25VxYsyxOgCfVZZb
VFYpZp3QmgfHlaPLc5Hqn9o=
=0Y2J
-----END PGP SIGNATURE-----
home | help

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