#include "mem.h" #include #include void *M(void *p, size_t old, size_t new) { if (new == 0) { free(p); return NULL; } else { void *x = realloc(p, new); if (x == NULL) { printf("out of memory! aaaaaaa!!!!!\n"); exit(42); } return x; } } Obj *alloc_obj(size_t sz, ObjTy oty) { Obj *o = M(NULL, 0, sz); o->oty = oty; return o; }