Fix TEMPORARY bug and add regression test.
[pspp-builds.git] / src / alloc.h
index 50e7ab1f10bb6c418811051892f506202599c505..b1b34d0fec11e452f1a2e049ed0caf0383f6b8a0 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);
+\f
+/* alloca() wrapper functions. */
+#if defined (HAVE_ALLOCA) || defined (C_ALLOCA)
+#include <alloca.h>
+#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 */