lkml.org 
[lkml]   [2012]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Uninline kcalloc
On Wed, 15 Feb 2012, Xi Wang wrote:

> for overflow, one has to write:
>
> size_t s = calculate_array_size(n, size);
> if (s)
> p = kmalloc(s, ...);
>
> This "if" thing is just too verbose --- you need three lines to
> allocate an array.
>
> We could change calculate_array_size() to return ULONG_MAX or some
> large number with which kmalloc() would fail. Then one would write:

Any allocation larger than MAX_ORDER << PAGE_SHIFT will fail since the
page allocator cannot serve larger contigous pages.




\
 
 \ /
  Last update: 2012-02-15 20:37    [from the cache]
©2003-2011 Jasper Spaans