comparison src/alloc.c @ 55836:a05a653f63af

(lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN. Clean up HAVE_POSIX_MEMALIGN handling of `err'.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 May 2004 16:10:27 +0000
parents a4fe04f4d9c2
children ca648e6d2d7b
comparison
equal deleted inserted replaced
55835:41c33773289f 55836:a05a653f63af
752 #endif 752 #endif
753 753
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)
771 ((void**)abase)[-1] = base; 774 ((void**)abase)[-1] = base;
772 775