Proposed addition of malloc_size_np()

Gunther Nikl gni at gecko.de
Wed Mar 29 08:48:36 UTC 2006


On Tue, Mar 28, 2006 at 08:11:53PM +1100, Peter Jeremy wrote:
> On Mon, 2006-Mar-27 12:52:17 -0800, Jason Evans wrote:
> >void *
> >malloc(size_t size);
> >
> >void *
> >calloc(size_t size);
> >
> >void *
> >realloc(void *ptr, size_t size, size_t old_size);
> >
> >void
> >free(void *ptr, size_t size);
> 
> ISTR AmigaDOS did something like this (my autodocs are packed away
> somewhere so I can't quickly check).

FYI, its AllocMem (which also has a flags argument) and FreeMem. Later
AllocVec (caching the size) and FreeVec were added to the system. Since
using these system functins will lead to fragmented memory new functions
were added using pools. An anpplication allocated a pool and then allocated
from that pool. Then it could free individual allocations or deallocate the
pool which would release all memory from the pool at once.

Gunther


More information about the freebsd-arch mailing list