diff options
author | Richard M. Stallman <[email protected]> | 1994-07-13 19:10:27 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1994-07-13 19:10:27 +0000 |
commit | 20e15dfd12e30a599ba480c73aca0b1662c4cd80 (patch) | |
tree | 7a84b0e759a2880484ea2854d00da025ff793964 /lib-src | |
parent | bab863c394701196217116c2c1214111860756c9 (diff) |
(xmalloc): New function.
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/timer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib-src/timer.c b/lib-src/timer.c index acb84ea558..1fd7836802 100644 --- a/lib-src/timer.c +++ b/lib-src/timer.c @@ -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 */ |