Beispiel #1
0
void*
erealloc(void *p, uint n)
{
	p = realloc(p, n);
	if(p == nil)
		error("realloc failed");
	setrealloctag(p, getcallerpc(&p));
	return p;
}
Beispiel #2
0
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;
}
Beispiel #3
0
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;
}
Beispiel #4
0
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;
}
Beispiel #5
0
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;
}