• Paul Eggert's avatar
    Fix GC bugs --with-wide-int and Qnil == 0 · 93f4f67b
    Paul Eggert authored
    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.
    93f4f67b
alloc.c 198 KB