Subject: Re: Extensible malloc types
To: Jason R Thorpe <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-kern
Date: 01/31/2003 11:12:29
>Feedback appreciated.

well, apart from the well-deserved kudos..

My own tree has a port of FreeBSD's MALLOC_{DECLARE,DEFINE}.  I found
the FreeBSD code used an atrocious overloading of the ks_limit field
of each malloc_type: if zero, the malloc_type uninitialized. If
non-zero, the malloc_type object is initalized and in the list.
I reworked the macros (API change) to allow passing an explicit
ks_limit value, without creating cycles in the list structures.

The explicit limits can be a real win for embedded applications.  (The
alternative is to give all malloc-types some fixed percentage of the
total available kva-space, which is pretty lame.)

Worth buying back?