Re: kernel: use kcalloc instead kmalloc/memset

From: Pekka J Enberg
Date: Fri Aug 05 2005 - 05:20:54 EST


On Fri, 5 Aug 2005, Arjan van de Ven wrote:
> kcalloc does have value, in that it's a nice api to avoid multiplication
> overflows. Just for "1" it's indeed not the most useful API.

Roman Zippel writes:
This would imply a similiar kmalloc() would be useful as well.
Second, how relevant is it for the kernel? Is that really the best place to check for rogue user parameters?

Please note that the first version of kcalloc() carried over from ALSA took only one size parameter but we decided to make it similar to standard calloc(). It is useful as an array allocator which is why I think we should keep both and simply get rid of the kcalloc(1,...) form.

Pekka

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/