(xmalloc): New function.
This commit is contained in:
parent
bab863c394
commit
20e15dfd12
1 changed files with 17 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue