3 * Various utility functions.
5 * Copyright (c) 2002 Chris Lightfoot. All rights reserved.
6 * Email: chris@ex-parrot.com; WWW: http://www.ex-parrot.com/~chris/
10 static const char rcsid[] = "$Id: util.c,v 1.1 2002/03/24 17:27:12 chris Exp $";
12 #include <sys/types.h>
23 * Malloc, and abort if malloc fails. */
24 void *xmalloc(size_t n) {
33 void *xcalloc(size_t n, size_t m) {
42 void *xrealloc(void *w, size_t n) {
45 if (n != 0 && !v) abort();
51 char *xstrdup(const char *s) {
59 * Free, ignoring a passed NULL value. */