From owner-freebsd-arch@FreeBSD.ORG Sat Mar 25 07:47:41 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 EE19F16A400; Sat, 25 Mar 2006 07:47:41 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id 927C243D45; Sat, 25 Mar 2006 07:47:41 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (0x535c0e2a.sgnxx1.adsl-dhcp.tele.dk [83.92.14.42]) by pasmtp.tele.dk (Postfix) with ESMTP id AC4061EC318; Sat, 25 Mar 2006 08:47:40 +0100 (CET) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.4/8.13.4) with ESMTP id k2P7ldZr062793; Sat, 25 Mar 2006 08:47:40 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: John-Mark Gurney From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 24 Mar 2006 20:51:49 PST." <20060325045149.GA7001@funkthat.com> Date: Sat, 25 Mar 2006 08:47:39 +0100 Message-ID: <62792.1143272859@critter.freebsd.dk> Sender: phk@critter.freebsd.dk 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: Sat, 25 Mar 2006 07:47:42 -0000 In message <20060325045149.GA7001@funkthat.com>, John-Mark Gurney writes: >a) the idea of using memory beyond what you've allocated is bad... Not if you get permission. >b) it should return the maximum size you can realloc to w/o a copy >of the memory... and then the way you use the extra memory is to >call realloc on the buffer to the value returned by malloc_size_np.. This is not an easy number to return, and it is dynamic. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.