commit - 641405320f4601f50e0d728805e14fb6f8196710
commit + b1cd1d55e1418f2ed8236d488f815d0108b99598
blob - b4414951fe2d219a8d85fa1e97fae66d5a6f1aff
blob + c44f506dbb9a49c0ac1f08c169bed68ad461aea7
--- src/lib9p/mem.c
+++ src/lib9p/mem.c
{
void *v;
- if((v = malloc(sz)) == nil) {
- fprint(2, "out of memory allocating %lud\n", sz);
- exits("mem");
- }
+ if((v = malloc(sz)) == nil)
+ sysfatal("out of memory allocating %lud", sz);
memset(v, 0, sz);
setmalloctag(v, getcallerpc(&sz));
return v;
{
void *nv;
- if((nv = realloc(v, sz)) == nil) {
- fprint(2, "out of memory allocating %lud\n", sz);
- exits("mem");
- }
+ if((nv = realloc(v, sz)) == nil)
+ sysfatal("out of memory reallocating %lud", sz);
if(v == nil)
setmalloctag(nv, getcallerpc(&v));
setrealloctag(nv, getcallerpc(&v));
{
char *t;
- if((t = strdup(s)) == nil) {
- fprint(2, "out of memory in strdup(%.10s)\n", s);
- exits("mem");
- }
+ if((t = strdup(s)) == nil)
+ sysfatal("out of memory in strdup(%.20s)", s);
setmalloctag(t, getcallerpc(&s));
return t;
}