aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorRichard M. Stallman2004-05-29 16:10:27 +0000
committerRichard M. Stallman2004-05-29 16:10:27 +0000
commitab349c191f048bb078ef7a534e271c7a5d7727b5 (patch)
treea66d7a7567f8b0bcaa7ace2829611acd0b33eba5 /src/alloc.c
parent5de706b23a974f89aa67e825c9a2e5f7b621bf5c (diff)
downloademacs-ab349c191f048bb078ef7a534e271c7a5d7727b5.tar.gz
emacs-ab349c191f048bb078ef7a534e271c7a5d7727b5.zip
(lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN.
Clean up HAVE_POSIX_MEMALIGN handling of `err'.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 5 insertions, 2 deletions
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)
754#ifdef HAVE_POSIX_MEMALIGN 754#ifdef HAVE_POSIX_MEMALIGN
755 { 755 {
756 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); 756 int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES);
757 abase = err ? (base = NULL) : base; 757 if (err)
758 base = NULL;
759 abase = base;
758 } 760 }
759#else 761#else
760 base = malloc (ABLOCKS_BYTES); 762 base = malloc (ABLOCKS_BYTES);
761 abase = ALIGN (base, BLOCK_ALIGN); 763 abase = ALIGN (base, BLOCK_ALIGN);
764#endif
765
762 if (base == 0) 766 if (base == 0)
763 { 767 {
764 UNBLOCK_INPUT; 768 UNBLOCK_INPUT;
765 memory_full (); 769 memory_full ();
766 } 770 }
767#endif
768 771
769 aligned = (base == abase); 772 aligned = (base == abase);
770 if (!aligned) 773 if (!aligned)