changeset 8241:a16dfe068972

(xmalloc): New function.
author Richard M. Stallman <rms@gnu.org>
date Wed, 13 Jul 1994 19:10:27 +0000
parents 363f719d47a5
children 824eeccd8203
files lib-src/=timer.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/=timer.c	Wed Jul 13 17:19:23 1994 +0000
+++ b/lib-src/=timer.c	Wed Jul 13 19:10:27 1994 +0000
@@ -349,4 +349,21 @@
 
 #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 */