Proposed addition of malloc_size_np()

Andrew Reilly andrew-freebsd at areilly.bpc-users.org
Mon Mar 27 01:17:13 UTC 2006


On Sat, Mar 25, 2006 at 09:19:23AM +0100, Poul-Henning Kamp wrote:
> In message <20060325081037.GC703 at 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


More information about the freebsd-arch mailing list