shithub: riscv

ref: 6f15a730f351b75f24286cb937a96db1ee9e5b82
dir: /sys/src/libc/port/calloc.c/

View raw version
#include <u.h>
#include <libc.h>

void*
calloc(ulong n, ulong s)
{
	void *v;
	if(n > 1 && ((ulong)-1)/n < s)
		return nil;
	if(v = mallocz(n*s, 1))
		setmalloctag(v, getcallerpc(&n));
	return v;
}