changeset 81798:3b39669cb653

(mark_maybe_pointer): Enforce mult-of-8 alignment when using USE_LSB_TAG. Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 10 Jul 2007 18:00:44 +0000
parents cf9acee3da75
children a1047475197b
files src/ChangeLog src/alloc.c
diffstat 2 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Jul 10 17:47:32 2007 +0000
+++ b/src/ChangeLog	Tue Jul 10 18:00:44 2007 +0000
@@ -1,5 +1,8 @@
 2007-07-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* alloc.c (mark_maybe_pointer): Enforce mult-of-8 alignment when using
+	USE_LSB_TAG.  Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
+
 	* fns.c (map_char_table): Use an array of int for `indices' rather than
 	an array of Lisp_Objects (which are only ever integers anyway).
 	(Fmap_char_table): Update caller.
--- a/src/alloc.c	Tue Jul 10 17:47:32 2007 +0000
+++ b/src/alloc.c	Tue Jul 10 18:00:44 2007 +0000
@@ -4263,9 +4263,14 @@
 {
   struct mem_node *m;
 
-  /* Quickly rule out some values which can't point to Lisp data.  We
-     assume that Lisp data is aligned on even addresses.  */
-  if ((EMACS_INT) p & 1)
+  /* Quickly rule out some values which can't point to Lisp data.  */
+  if ((EMACS_INT) p %
+#ifdef USE_LSB_TAG
+      8 /* USE_LSB_TAG needs Lisp data to be aligned on multiples of 8.  */
+#else
+      2 /* We assume that Lisp data is aligned on even addresses.  */
+#endif
+      )
     return;
 
   m = mem_find (p);