changeset 18701:9c7e0c926ed5

[C_ALLOCA] (xmalloc): New function.
author Richard M. Stallman <rms@gnu.org>
date Wed, 09 Jul 1997 19:20:34 +0000
parents cb17c9cd025b
children df65a2e6eb4e
files lib-src/emacsclient.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/emacsclient.c	Wed Jul 09 19:03:09 1997 +0000
+++ b/lib-src/emacsclient.c	Wed Jul 09 19:20:34 1997 +0000
@@ -137,6 +137,23 @@
 
   return copy;
 }
+
+#ifdef C_ALLOCA
+/* Like malloc but get fatal error if memory is exhausted.  */
+
+char *
+xmalloc (size)
+     unsigned int size;
+{
+  char *result = (char *) malloc (size);
+  if (result == NULL)
+  {
+    perror ("malloc");
+    exit (1);
+  }
+  return result;
+}
+#endif /* C_ALLOCA */
 
 #if !defined (HAVE_SOCKETS) && !defined (HAVE_SYSVIPC)