Date: Sat, 25 Mar 2006 08:47:39 +0100 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: John-Mark Gurney <gurney_j@resnet.uoregon.edu> Cc: Jason Evans <jasone@FreeBSD.org>, freebsd-arch@FreeBSD.org Subject: Re: Proposed addition of malloc_size_np() Message-ID: <62792.1143272859@critter.freebsd.dk> In-Reply-To: Your message of "Fri, 24 Mar 2006 20:51:49 PST." <20060325045149.GA7001@funkthat.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?62792.1143272859>