/* $Cambridge: hermes/src/prayer/lib/misc.c,v 1.3 2008/09/16 09:59:57 dpc22 Exp $ */

#include "lib.h"

void *
xmalloc(unsigned long size)
{
    void *result = malloc(size);

    if (result)
        return(result);

    fprintf(stderr, "Failed to allocate %lu bytes", size);
    exit(1);
}

void *
xrealloc(void *old, unsigned long size)
{
    void *result = realloc(old, size);

    if (result)
        return(result);

    fprintf(stderr, "Failed to allocate %lu bytes", size);
    exit(1);
}

