Proposed addition of malloc_size_np()
Poul-Henning Kamp
phk at phk.freebsd.dk
Sat Mar 25 07:47:42 UTC 2006
In message <20060325045149.GA7001 at 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 at 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.
More information about the freebsd-arch
mailing list