shithub: asif

ref: 8b2dd20c6c68f54047b748c84a2444c1125e36c6
dir: /emalloc.c/

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

void *
erealloc(void *p, ulong n)
{
	if((p = realloc(p, n)) == nil)
		sysfatal("realloc: %r");
	setrealloctag(p, getcallerpc(&p));
	return p;
}

void *
emalloc(ulong n)
{
	void *p;

	if((p = mallocz(n, 1)) == nil)
		sysfatal("emalloc: %r");
	setmalloctag(p, getcallerpc(&n));
	return p;
}