lkml.org 
[lkml]   [2008]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vmallocinfo: Add NUMA informations
On Tue, Jun 10, 2008 at 12:05 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> yup. Oh well, it's not a big deal.
>
> Except the inlined
>
> if (n != 0 && size > ULONG_MAX / n)
> return NULL;
>
> is a bit bloaty/inefficient. I expect that it's often the case that
> one of `n' and `size' is not a compile-time constant.

I think it was out-of-line at first but then somebody made it inline
as an optimization...

On Tue, Jun 10, 2008 at 12:05 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> otoh, there's one good thing about kcalloc: it actually checks for
> multiplicative overflows, whereas the open-coded version often forgets
> to do that.

Yes. That's why we did kcalloc() in the first place. kzalloc() (aka
akpmalloc) came in much later.


\
 
 \ /
  Last update: 2008-06-09 23:17    [W:0.057 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site