Messages in this thread | | | Date | Tue, 10 Jun 2008 00:12:50 +0300 | From | "Pekka Enberg" <> | Subject | Re: [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.
| |