On Thu, Jul 10, 2014 at 10:28, Matthew Dempsky wrote:
> We've found a bunch of uses for reallocarray() in userland, and I
> think the idiom is worth reusing in the kernel.  There are enough
> places where we do malloc(x * y) that I think it makes sense to add
> mallocarray(x, y).

> +void *malloc(unsigned long size, int type, int flags);
> +void *mallocarray(unsigned long nmemb, unsigned long size,
> +         int type, int flags);

The unsigned long here is ancient history. It should be size_t I think.

> Index: sys/kern/kern_mallocarray.c

Please just add it to kern_malloc.c without creating a new file.

Reply via email to