Messages in this thread | | | Date | Fri, 19 Sep 2008 11:49:58 -0500 | From | Christoph Lameter <> | Subject | Re: [patch 3/4] cpu alloc: The allocator |
| |
Eric Dumazet wrote:
>> + unsigned long start; >> + int units = size_to_units(size); >> + void *ptr; >> + int first; >> + unsigned long flags; >> + >> + if (!size) >> + return ZERO_SIZE_PTR; >> + >> + WARN_ON(align > PAGE_SIZE); > > if (align < UNIT_SIZE) > align = UNIT_SIZE;
size_to_units() does round up:
/* * How many units are needed for an object of a given size */ static int size_to_units(unsigned long size) { return DIV_ROUND_UP(size, UNIT_SIZE); }
| |