8 This lib implements the "aborting" versions of
13 The program gets abort()ed if they can not allocate enough memory.
14 Thus the caller don't need to pay attention to returning NULL pointers.
18 void* mallocab(size_t size
)
22 if(size
!= 0 && ptr
== NULL
)
24 warnx("Failed to allocate %d bytes of memory.", size
);
30 void* reallocab(void* ptr0
, size_t size
)
33 ptr
= realloc(ptr0
, size
);
34 if(size
!= 0 && ptr
== NULL
)
36 warnx("Failed to reallocate %d bytes of memory.", size
);
42 char* strdupab(const char* ptr0
)
48 warnx("Failed to duplicate %p.", ptr0
);
54 char* strndupab(const char* ptr0
, size_t size
)
57 ptr
= strndup(ptr0
, size
);
60 warnx("Failed to duplicate %d bytes from %p.", size
, ptr0
);