plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

util.c (242B)


      1 #include <u.h>
      2 #include <libc.h>
      3 #include <diskfs.h>
      4 
      5 void*
      6 emalloc(ulong n)
      7 {
      8 	void *v;
      9 
     10 	v = mallocz(n, 1);
     11 	if(v == nil)
     12 		abort();
     13 	return v;
     14 }
     15 
     16 void*
     17 erealloc(void *v, ulong n)
     18 {
     19 	v = realloc(v, n);
     20 	if(v == nil)
     21 		abort();
     22 	return v;
     23 }