Subject: Re: amap_extend does unnecessary malloc/memcpy.
To: enami tsugutomo <enami@but-b.or.jp>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: tech-kern
Date: 11/19/2001 23:18:40
> +	if (size <= MAXALLOCSAVE)
> +		slotalloc = (1 << BUCKETINDX(size)) / sizeof(int);
> +	else
> +		slotalloc = roundup(size, PAGE_SIZE) / sizeof(int);

Rather than spreading implementation details about our kernel malloc
through the unrelated code elsewhere in the kernel, how about defining
a malloc_roundup() function or MALLOC_ROUNDUP() macro in malloc.h?

Since BUCKETINDX() expands to a *lot* of code, it should probably be a
function.

					- Bill