git: 9front

ref: abb18ee9881bf8bee6b64dadd964b7dcc1c58af7
dir: /sys/src/cmd/unix/drawterm/libc/mallocz.c/

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

void*
mallocz(ulong n, int clr)
{
	void *v;

	v = malloc(n);
	if(v && clr)
		memset(v, 0, n);
	return v;
}