void* erealloc(void *p, uint n) { p = realloc(p, n); if(p == nil) error("realloc failed"); setrealloctag(p, getcallerpc(&p)); return p; }
void * vtMemRealloc(void *p, int size) { if(p == nil) return vtMemAlloc(size); p = realloc(p, size); if(p == 0) vtFatal("vtRealloc: out of memory"); setrealloctag(p, getcallerpc(&size)); return p; }
void* erealloc(void *v, uint32_t n) { v = realloc(v, n); if(v == nil) { abort(); sysfatal("out of memory"); } setrealloctag(v, getcallerpc(&n)); return v; }
void * erealloc(void *p, uint32_t n) { p = realloc(p, n); if(p == nil){ if(abortonmem) abort(); sysfatal("out of memory allocating %lud", n); } setrealloctag(p, getcallerpc()); if(0)print("erealloc %p-%p by %#p\n", p, (char*)p+n, getcallerpc()); return p; }
void* erealloc9p(void *v, uint32_t sz) { void *nv; if((nv = realloc(v, sz)) == nil) { fprint(2, "out of memory allocating %lud\n", sz); exits("mem"); } if(v == nil) setmalloctag(nv, getcallerpc()); setrealloctag(nv, getcallerpc()); return nv; }