Messages in this thread | | | Date | Wed, 15 Feb 2012 13:34:11 -0600 (CST) | From | Christoph Lameter <> | Subject | Re: 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.
| |