Skip to content

Commit

Permalink
Revert "Skip GC_DS_PER_OBJECT objs with negative descriptor in GC_mar…
Browse files Browse the repository at this point in the history
…k_from"

Issue #137 (bdwgc).

This reverts commit 57f36b9.

Because it breaks gctest "list reversal" if compiled with
GC_GCJ_SUPPORT for MinGW/x86.  This is caused by the fact that static
data roots could be between two GC heap regions thus GC with the patch
skips scanning of a reachable GCJ object with a descriptor located in
the static data roots.

To fix the issue (#92) of mistaking the free list pointers in free
objects for being type descriptor pointers, another approach should be
taken (e.g. marking objects in free lists).
  • Loading branch information
ivmai committed Feb 6, 2017
1 parent 3bb4b6b commit 44d73c2
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,28 +767,6 @@ GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
mark_stack_top--;
continue;
}
if ((GC_word)(type_descr) >= (GC_word)GC_least_plausible_heap_addr
&& (GC_word)(type_descr)
<= (GC_word)GC_greatest_plausible_heap_addr) {
/* type_descr looks like a pointer into the heap. */
/* It could still be the link pointer in a free list */
/* though. That's not a problem as long as the offset */
/* of the actual descriptor in the pointed to object is */
/* within the same object. In that case it will either */
/* point at the next free object in the list (if offset */
/* is 0) or be zeroed (which we check for below, */
/* descr == 0). If the offset is larger than the */
/* objects in the block type_descr points to it cannot */
/* be a proper pointer. */
word offset = ~(descr + (GC_INDIR_PER_OBJ_BIAS
- GC_DS_PER_OBJECT - 1));
hdr *hhdr;
GET_HDR(type_descr, hhdr);
if (NULL == hhdr || hhdr->hb_sz - sizeof(word) < offset) {
mark_stack_top--;
continue;
}
}
descr = *(word *)(type_descr
- (descr + (GC_INDIR_PER_OBJ_BIAS
- GC_DS_PER_OBJECT)));
Expand Down

0 comments on commit 44d73c2

Please sign in to comment.