Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2006 19:10:38 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Jason Evans <jasone@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: Proposed addition of malloc_size_np()
Message-ID:  <20060325081037.GC703@turion.vk2pj.dyndns.org>
In-Reply-To: <62732.1143272796@critter.freebsd.dk>
References:  <44247DF1.8000002@FreeBSD.org> <62732.1143272796@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2006-Mar-25 08:46:36 +0100, Poul-Henning Kamp wrote:
>In message <44247DF1.8000002@FreeBSD.org>, Jason Evans writes:
>>=== Proposal ===
>>Add malloc_size_np() to libc, and provide the prototype in malloc_np.h:
>>
>>	size_t
>>	malloc_size_np(const void *ptr);
>
>I'm for the concept, but wonder if it would be smarter to make it
>
>	void *
>	malloc_np(size_t, size_t *)
>
>so we can do it in one go ?

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.

-- 
Peter Jeremy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060325081037.GC703>