Blob
1 #include <u.h>2 #include <libc.h>3 #include <thread.h>4 #include <sunrpc.h>6 void*7 emalloc(ulong n)8 {9 void *v;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 }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 }