diff options
| author | Richard M. Stallman | 1994-07-13 19:10:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-13 19:10:27 +0000 |
| commit | 20e15dfd12e30a599ba480c73aca0b1662c4cd80 (patch) | |
| tree | 7a84b0e759a2880484ea2854d00da025ff793964 /lib-src/timer.c | |
| parent | bab863c394701196217116c2c1214111860756c9 (diff) | |
| download | emacs-20e15dfd12e30a599ba480c73aca0b1662c4cd80.tar.gz emacs-20e15dfd12e30a599ba480c73aca0b1662c4cd80.zip | |
(xmalloc): New function.
Diffstat (limited to 'lib-src/timer.c')
| -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 acb84ea5583..1fd7836802f 100644 --- a/lib-src/timer.c +++ b/lib-src/timer.c | |||
| @@ -349,4 +349,21 @@ strerror (errnum) | |||
| 349 | 349 | ||
| 350 | #endif /* ! HAVE_STRERROR */ | 350 | #endif /* ! HAVE_STRERROR */ |
| 351 | 351 | ||
| 352 | long * | ||
| 353 | xmalloc (size) | ||
| 354 | int size; | ||
| 355 | { | ||
| 356 | register long *val; | ||
| 357 | |||
| 358 | val = (long *) malloc (size); | ||
| 359 | |||
| 360 | if (!val && size) | ||
| 361 | { | ||
| 362 | fprintf (stderr, "timer: virtual memory exceeded\n"); | ||
| 363 | exit (1); | ||
| 364 | } | ||
| 365 | |||
| 366 | return val; | ||
| 367 | } | ||
| 368 | |||
| 352 | /* timer.c ends here */ | 369 | /* timer.c ends here */ |