xref: /plan9/sys/src/cmd/unix/drawterm/libc/mallocz.c (revision 8ccd4a6360d974db7bd7bbd4f37e7018419ea908)
1 #include <u.h>
2 #include <libc.h>
3 
4 void*
mallocz(ulong n,int clr)5 mallocz(ulong n, int clr)
6 {
7 	void *v;
8 
9 	v = malloc(n);
10 	if(v && clr)
11 		memset(v, 0, n);
12 	return v;
13 }
14