lkml.org 
[lkml]   [2008]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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);
}



\
 
 \ /
  Last update: 2008-09-19 18:55    [W:0.067 / U:3.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site