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>
next in thread | previous in thread | raw e-mail | index | archive | help
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
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=20
> allocation pointed to by ptr. The return value may be larger than the=20
> size that was requested during allocation. malloc_usable_size() is not=
=20
> intended as a mechanism for in-place realloc(), though it can be abused=
=20
> that way; rather it is primarily provided as a tool for introspection=20
> purposes. Any discrepancy between the requested allocation size and the=
=20
> size reported by malloc_usable_size() should not be depended on, since=20
> 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?
--=20
Vasil Dimov
gro.DSBeerF@dv
Testing can show the presence of bugs, but not their absence.
-- Edsger W. Dijkstra
--xHFwDpU9dbj6ez1V
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
iD8DBQFEKMiFFw6SP/bBpCARAkXJAJ4rJIhi37k9Q/to78mu25VxYsyxOgCfVZZb
VFYpZp3QmgfHlaPLc5Hqn9o=
=0Y2J
-----END PGP SIGNATURE-----
--xHFwDpU9dbj6ez1V--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060328052421.GA97222>
