From owner-freebsd-arch@FreeBSD.ORG Mon Mar 27 01:17:13 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 9DEA616A400 for ; Mon, 27 Mar 2006 01:17:13 +0000 (UTC) (envelope-from andrew@areilly.bpc-users.org) Received: from omta01ps.mx.bigpond.com (omta01ps.mx.bigpond.com [144.140.82.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 036CF43D46 for ; Mon, 27 Mar 2006 01:17:08 +0000 (GMT) (envelope-from andrew@areilly.bpc-users.org) Received: from areilly.bpc-users.org ([141.168.4.160]) by omta01ps.mx.bigpond.com with ESMTP id <20060327011706.ORHR19070.omta01ps.mx.bigpond.com@areilly.bpc-users.org> for ; Mon, 27 Mar 2006 01:17:06 +0000 Received: (qmail 66247 invoked by uid 501); 26 Mar 2006 21:03:41 -0000 Date: Mon, 27 Mar 2006 08:03:41 +1100 From: Andrew Reilly To: Poul-Henning Kamp Message-ID: <20060326210341.GA66065@gurney.reilly.home> References: <20060325081037.GC703@turion.vk2pj.dyndns.org> <62921.1143274763@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62921.1143274763@critter.freebsd.dk> User-Agent: Mutt/1.4.2.1i Cc: Jason Evans , 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 List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2006 01:17:13 -0000 On Sat, Mar 25, 2006 at 09:19:23AM +0100, Poul-Henning Kamp wrote: > In message <20060325081037.GC703@turion.vk2pj.dyndns.org>, Peter Jeremy writes: > >That restricts its use to malloc() wrappers. I can also see the > >benefit in a function trying to validate the size of an arbitrary > >piece of memory that has been passed to it. > > No you can't, because you cannot be certain that the pointer passed > to you is actually an unadultered malloc pointer. Or even that it was 'alloc'd at all. Could be a pointer (in)to a static or global... -- Andrew