(lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN.
authorRichard M. Stallman <rms@gnu.org>
Sat, 29 May 2004 16:10:27 +0000 (16:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 29 May 2004 16:10:27 +0000 (16:10 +0000)
Clean up HAVE_POSIX_MEMALIGN handling of `err'.

src/alloc.c

index 0a0b25b..055f5d8 100644 (file)
@@ -754,17 +754,20 @@ lisp_align_malloc (nbytes, type)
 #ifdef HAVE_POSIX_MEMALIGN
       {
        int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES);
-       abase = err ? (base = NULL) : base;
+       if (err)
+         base = NULL;
+       abase = base;
       }
 #else
       base = malloc (ABLOCKS_BYTES);
       abase = ALIGN (base, BLOCK_ALIGN);
+#endif
+
       if (base == 0)
        {
          UNBLOCK_INPUT;
          memory_full ();
        }
-#endif
 
       aligned = (base == abase);
       if (!aligned)