From: Richard M. Stallman Date: Sat, 29 May 2004 16:10:27 +0000 (+0000) Subject: (lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN. X-Git-Tag: ttn-vms-21-2-B4~6005 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab349c191f048bb078ef7a534e271c7a5d7727b5;p=emacs.git (lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN. Clean up HAVE_POSIX_MEMALIGN handling of `err'. --- diff --git a/src/alloc.c b/src/alloc.c index 0a0b25bcb7d..055f5d82347 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -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)