• Paul Eggert's avatar
    Make garbage collection more conservative · e13bdfee
    Paul Eggert authored
    Check for a pointer anywhere within the object, as opposed to just
    the start of the object.  This is needed for gcc -Os -flto on
    x86-64 (Bug#28213).  This change means that the garbage collector
    is more conservative, and will incorrectly keep objects that it
    does not need to, but that is better than incorrectly discarding
    objects that should be kept.
    * src/alloc.c (ADVANCE, VINDEX): Now functions, not macros;
    this is easier to debug.
    (setup_on_free_list): Rename from SETUP_ON_FREE_LIST.
    Now a function with two args, not a macro with three.
    All callers changed.
    (live_string_holding, live_cons_holding, live_symbol_holding)
    (live_misc_holding, live_vector_holding, live_buffer_holding):
    New functions, which check for any object containing the addressed
    byte, not just for an object at the given address.
    (live_string_p, live_cons_p, live_symbol_p, live_misc_p)
    (live_vector_p, live_buffer_p):
    Redefine in terms of the new functions.
    (live_float_p): Refactor slightly to match the new functions.
    (mark_maybe_object, mark_maybe_pointer): Use the new functions.
    Don’t bother checking mark bits, as mark_object already does that,
    and omitting the checks here simplifies the code.  Although
    mark_maybe_object can continue to insist that tagged pointers
    still address the start of the object, mark_maybe_pointer now is
    more conservative and checks for pointers anywhere into an object.
    e13bdfee
alloc.c 205 KB