(xmalloc): New function.

This commit is contained in:
Richard M. Stallman 1994-07-13 19:10:27 +00:00
parent bab863c394
commit 20e15dfd12

View file

@ -349,4 +349,21 @@ strerror (errnum)
#endif /* ! HAVE_STRERROR */
long *
xmalloc (size)
int size;
{
register long *val;
val = (long *) malloc (size);
if (!val && size)
{
fprintf (stderr, "timer: virtual memory exceeded\n");
exit (1);
}
return val;
}
/* timer.c ends here */