Added a test for reading/writing of portable files.
[pspp-builds.git] / src / alloc.h
index 50e7ab1f10bb6c418811051892f506202599c505..b1b1cc5ea249ea7fb43ac30379352bead32c76f0 100644 (file)
 
 #include <stddef.h>
 
-/* Functions. */
+/* malloc() wrapper functions. */
 void *xmalloc (size_t size);
 void *xcalloc (size_t size);
 void *xrealloc (void *ptr, size_t size);
 char *xstrdup (const char *s);
+void out_of_memory (void) NO_RETURN;
+\f
+/* alloca() wrapper functions. */
+#if defined (HAVE_ALLOCA) || defined (C_ALLOCA)
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#define local_alloc(X) alloca (X)
+#define local_free(P) ((void) 0)
+#else
+#define local_alloc(X) xmalloc (X)
+#define local_free(P) free (P)
+#endif
 
 #endif /* alloc.h */