Ignore:
Timestamp:
Apr 21, 2011, 9:20:04 PM (10 years ago)
Author:
gb
Message:

In mark_memoized_area() on all platforms, don't do any special
processing of weak-on-value hash vectors. (This means that otherwise
unreferenced values in weak-on-value hash tables will only be free
on a full GC.) This seems to fix (at least the symptom of) ticket:817,
or at least allows my test case to run to completion.

The real problem is that sometimes those weak-on-value hash vectors
aren't on GCweakvll; if we don't mark the values in the weak vector
in mark_memoized_area(), nothing deletes unmarked values from the
hash table (or otherwise completes weak processing.) I was unable
to determine why the vectors were sometimes missing from the list;
not dropping them in init_weakvll() didn't seem to fix anything.

One approach to fixing the real problem is to say:

  • we somehow ensure that tenured weak-on-value hash vectors always have refbits set for their headers.
  • on entry to the GC, GCweakvll is empty (or at least contains no hash vectors).
  • mark_memoized_area does weak processing of all tenured weak hash vectors. If it finds that the vector contains intergenerational references to weak elements, it pushes the vector on GCweakvll.
  • if lisp_global(WEAKVLL) and init_weakvll() need to continue to exist, that's only so that weak list headers can be preprocessed. It'd be nice to think of a way of doing that preprocessing via other means.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-gc.c

    r14495 r14723  
    887887        hash_table_vector_header *hp = (hash_table_vector_header *)(p - 2);
    888888        if (hp->flags & nhash_weak_mask) {
    889           /* If header_count is odd, this cuts off the last header field */
    890           /* That case is handled specially above */
    891           hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1);
    892           hashp = hp;
    893           mark_method = 3;
     889          /* Workaround for ticket:817 */
     890          if (!(hp->flags & nhash_weak_value_mask)) {
     891            /* If header_count is odd, this cuts off the last header field */
     892            /* That case is handled specially above */
     893            hash_dnode_limit = memo_dnode + ((hash_table_vector_header_count) >>1);
     894            hashp = hp;
     895            mark_method = 3;
     896          }
    894897        }
    895898      }
Note: See TracChangeset for help on using the changeset viewer.