blob: ce617412256089359171223d7dbbc5d6e8ab6e02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <u.h>
#include <libc.h>
#include <thread.h>
#include <sunrpc.h>
void*
emalloc(ulong n)
{
void *v;
v = mallocz(n, 1);
if(v == nil)
{
abort();
sysfatal("out of memory");
}
setmalloctag(v, getcallerpc(&n));
return v;
}
void*
erealloc(void *v, ulong n)
{
v = realloc(v, n);
if(v == nil)
{
abort();
sysfatal("out of memory");
}
setrealloctag(v, getcallerpc(&n));
return v;
}
|