On Wed, May 18, 2011 at 10:27:43AM +1000, Damien Miller wrote:
> On Sun, 15 May 2011, Otto Moerbeek wrote:
>
> > Hi,
> >
> > define MALLOC_MAXSHIFT and related stuff more consistently. Also, zap
> > region_bits, it is not used.
>
> looks ok. some questions:
>
> > - struct chunk_head chunk_dir[MALLOC_MAXSHIFT];
> > + struct chunk_head chunk_dir[MALLOC_MAXSHIFT + 1];
>
> Why does this grow? Isn't the MALLOC_MAXSHIFT changes above a noop as far
> as the actual values are concerned?
MALLOC_MAXSHIFT fist was 16, but now it's the actual shift used for
maximum sized chunks (half a page).
>
> > - d->regions_bits = 9;
> > - d->regions_free = d->regions_total = 1 << d->regions_bits;
> > + d->regions_free = d->regions_total = 512;
>
> Maybe make this a #define too?
Yes, wll do.
>
> > - for (i = 0; i < MALLOC_MAXSHIFT; i++)
> > + for (i = 0; i <= MALLOC_MAXSHIFT; i++)
>
> Because of the array size change above?
Yes, the last slot is actually used now.
-Otto