From owner-freebsd-arch@FreeBSD.ORG Tue Mar 28 05:24:23 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org 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 840E716A41F; Tue, 28 Mar 2006 05:24:23 +0000 (UTC) (envelope-from vd@datamax.bg) Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BDFE43D48; Tue, 28 Mar 2006 05:24:22 +0000 (GMT) (envelope-from vd@datamax.bg) Received: from qlovarnika.bg.datamax (qlovarnika.bg.datamax [192.168.10.2]) by jengal.datamax.bg (Postfix) with SMTP id 3D023B857; Tue, 28 Mar 2006 08:24:21 +0300 (EEST) Received: (nullmailer pid 97374 invoked by uid 1002); Tue, 28 Mar 2006 05:24:21 -0000 Date: Tue, 28 Mar 2006 08:24:21 +0300 From: Vasil Dimov To: Jason Evans Message-ID: <20060328052421.GA97222@qlovarnika.bg.datamax> References: <44247DF1.8000002@FreeBSD.org> <20060326110929.V35431@fledge.watson.org> <4426D7A0.4040007@FreeBSD.org> <200603271110.02917.jhb@freebsd.org> <44281421.3060401@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <44281421.3060401@FreeBSD.org> X-OS: FreeBSD 6.0-STABLE User-Agent: Mutt/1.5.11 Cc: Robert Watson , freebsd-arch@freebsd.org Subject: Re: Proposed addition of malloc_size_np() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vd@FreeBSD.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2006 05:24:23 -0000 --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--