// util/alloc.h, version 1.0.1 // Memory allocation source file from libutil // Copyright (C) 2021, Jakob Wakeling // MIT Licence #include "alloc.h" #include "error.h" #include void *xmalloc(UINT l) { void *q = malloc(l); if (!q) { error(1, "%s", SERR); } return q; } void *xcalloc(UINT n, UINT l) { void *q = calloc(n, l); if (!q) { error(1, "%s", SERR); } return q; } void *xrealloc(void *p, UINT l) { void *q = realloc(p, l); if (!q) { error(1, "%s", SERR); } return q; }