* ports.h: #include <sys/types.h>, to get a definition for `off_t'.
[bpt/guile.git] / libguile / alloca.c
index 8f98b73..0980dd7 100644 (file)
@@ -22,7 +22,7 @@
    your main control loop, etc. to force garbage collection.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include <scmconfig.h>
 #endif
 
 #ifdef HAVE_STRING_H
@@ -77,21 +77,6 @@ typedef char *pointer;
 #define        NULL    0
 #endif
 
-/* Different portions of Emacs need to call different versions of
-   malloc.  The Emacs executable needs alloca to call xmalloc, because
-   ordinary malloc isn't protected from input signals.  On the other
-   hand, the utilities in lib-src need alloca to call malloc; some of
-   them are very simple, and don't have an xmalloc routine.
-
-   Non-Emacs programs expect this to call use xmalloc.
-
-   Callers below should use malloc.  */
-
-#ifndef emacs
-#define malloc xmalloc
-#endif
-extern pointer malloc ();
-
 /* Define STACK_DIRECTION if you know the direction of stack
    growth for your system; otherwise it will be automatically
    deduced at run-time.
@@ -215,11 +200,14 @@ alloca (size)
   /* Allocate combined header + user data storage.  */
 
   {
-    register pointer new = malloc (sizeof (header) + size);
+    register pointer new = (pointer) malloc (sizeof (header) + size);
     /* Address of header.  */
 
     if (new == 0)
-      abort();
+      {
+       write (2, "alloca emulation: out of memory\n", 32);
+       abort();
+      }
 
     ((header *) new)->h.next = last_alloca_header;
     ((header *) new)->h.deep = depth;