shithub: vdict

ref: 58d42407b1ad3ae4a4a06b097deb01d2cc2a883e
dir: /utils.c/

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <draw.h>
#include <thread.h>
#include "a.h"

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

	p = malloc(size);
	if(p == nil)
		sysfatal("malloc: %r");
	return p;
}

void*
erealloc(void *p, ulong size)
{
	void *q;

	q = realloc(p, size);
	if(q == nil)
		sysfatal("realloc: %r");
	return q;
}