Fix GC bugs --with-wide-int and Qnil == 0
commit93f4f67ba93b78e8b31e498e8ce7bce4c8298b76
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Jun 2015 03:10:03 +0000 (24 20:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 25 Jun 2015 03:10:44 +0000 (24 20:10 -0700)
tree788c0808926664ea23de2f903f4c233c5febf7ab
parentf230b2ff3136120a9be544a5d3a974f7087ce55b
Fix GC bugs --with-wide-int and Qnil == 0

Use the same alignment for the !USE_LSB_TAG case as for the
more-typical USE_LSB_TAG case.  The attempt to support arbitrary
alignments with !USE_LSB_TAG had subtle bugs in garbage collection
once we changed the representation of symbols so that Qnil == 0.
Problem reported by Eli Zaretskii (Bug#20862).
* src/alloc.c (XMALLOC_HEADER_ALIGNMENT) [XMALLOC_OVERRUN_CHECK]:
* src/alloc.c (vector_alignment, union aligned_Lisp_Symbol)
(union aligned_Lisp_Misc, maybe_lisp_pointer, pure_alloc):
Use same alignment for !USE_LSB_TAG as for USE_LSB_TAG.
* src/alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): Remove.
This optimization in the !USE_LSB_TAG case is no longer valid when
symbols are represented via offsets.  Change the only use to
assume that pointers might hide in objects.
* src/lisp.h (alignas) [!USE_LSB_TAG]:
Require support in this case, too.
(TAG_SYMOFFSET, XSYMBOL) [!USE_LSB_TAG]: Do not shift the offset.
This is OK, because the !USE_LSB_TAG case now applies only when
Lisp_Object is wider than void *, so there's no longer any need
to shift the offset.  Not shifting the offset means that
symbol representations have the same alignment as pointers,
which the GC assumes.
src/alloc.c
src/lisp.h