]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libsunrpc/emalloc.c
9bootfat: rename open() to fileinit and make it static as its really a internal funct...
[plan9front.git] / sys / src / libsunrpc / emalloc.c
1 #include <u.h>
2 #include <libc.h>
3 #include <thread.h>
4 #include <sunrpc.h>
5
6 void*
7 emalloc(ulong n)
8 {
9         void *v;
10
11         v = mallocz(n, 1);
12         if(v == nil)
13 {
14 abort();
15                 sysfatal("out of memory");
16 }
17         setmalloctag(v, getcallerpc(&n));
18         return v;
19 }
20
21 void*
22 erealloc(void *v, ulong n)
23 {
24         v = realloc(v, n);
25         if(v == nil)
26 {
27 abort();
28                 sysfatal("out of memory");
29 }
30         setrealloctag(v, getcallerpc(&n));
31         return v;
32 }
33
34