]> Savannah Git Hosting - gnulib.git/commitdiff
malloca: Tweak last commit.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 13:19:33 +0000 (15:19 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 13:19:33 +0000 (15:19 +0200)
* lib/malloca.h: Keep use and declaration of mmalloca close together.

ChangeLog
lib/malloca.h

index 7bdffe9438195f68ddb8d31a95e9d78127c90d5d..47f05b35fc8e0cfd57bf92d71db339d7da0cf937 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       malloca: Tweak last commit.
+       * lib/malloca.h: Keep use and declaration of mmalloca close together.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        dirname-lgpl, sh-quote, system-quote, xstriconv: Clean up includes.
index dbbec3f065247c0ea4d877996eb654f62b24eb3a..7eb63d2a7523a3b96fb226ccded613984b68fe4c 100644 (file)
@@ -51,6 +51,13 @@ extern "C" {
 # define safe_alloca(N) ((void) (N), NULL)
 #endif
 
+/* Free a block of memory allocated through malloca().  */
+#if HAVE_ALLOCA
+extern void freea (void *p);
+#else
+# define freea free
+#endif
+
 /* malloca(N) is a safe variant of alloca(N).  It allocates N bytes of
    memory allocated on the stack, that must be freed using freea() before
    the function returns.  Upon failure, it returns NULL.  */
@@ -65,14 +72,6 @@ extern "C" {
 # define malloca(N) \
   mmalloca (N)
 #endif
-
-/* Free a block of memory allocated through malloca().  */
-#if HAVE_ALLOCA
-extern void freea (void *p);
-#else
-# define freea free
-#endif
-
 extern void *mmalloca (size_t n)
   _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (freea, 1)
   _GL_ATTRIBUTE_ALLOC_SIZE ((1));