diff options
-rw-r--r-- | backgraph.c | 2 | ||||
-rw-r--r-- | dbg_mlc.c | 4 | ||||
-rw-r--r-- | include/gc/gc_mark.h | 9 | ||||
-rw-r--r-- | malloc.c | 2 | ||||
-rw-r--r-- | mark.c | 19 | ||||
-rw-r--r-- | typd_mlc.c | 2 |
6 files changed, 19 insertions, 19 deletions
diff --git a/backgraph.c b/backgraph.c index 6eac9c8e..fbd48d76 100644 --- a/backgraph.c +++ b/backgraph.c @@ -357,7 +357,7 @@ static void add_back_edges(ptr_t p, size_t n_bytes, word gc_descr) LOAD_WORD_OR_CONTINUE(current, current_p); FIXUP_POINTER(current); if (current >= (word)GC_least_plausible_heap_addr && - current <= (word)GC_greatest_plausible_heap_addr) { + current < (word)GC_greatest_plausible_heap_addr) { ptr_t target = (ptr_t)GC_base((void *)current); if (0 != target) { add_edge(p, target); @@ -134,9 +134,9 @@ ptr_t alternate_target = *(ptr_t *)alternate_ptr; if ((word)alternate_target >= (word)GC_least_plausible_heap_addr - && (word)alternate_target <= (word)GC_greatest_plausible_heap_addr + && (word)alternate_target < (word)GC_greatest_plausible_heap_addr && ((word)target < (word)GC_least_plausible_heap_addr - || (word)target > (word)GC_greatest_plausible_heap_addr)) { + || (word)target >= (word)GC_greatest_plausible_heap_addr)) { bp = alternate_ptr; } } diff --git a/include/gc/gc_mark.h b/include/gc/gc_mark.h index 8291b1a4..ceba353d 100644 --- a/include/gc/gc_mark.h +++ b/include/gc/gc_mark.h @@ -125,10 +125,11 @@ typedef struct GC_ms_entry * (*GC_mark_proc)(GC_word * /* addr */, GC_API void * GC_least_plausible_heap_addr; GC_API void * GC_greatest_plausible_heap_addr; - /* Bounds on the heap. Guaranteed valid */ + /* Bounds on the heap. Guaranteed to be valid. */ /* Likely to include future heap expansion. */ /* Hence usually includes not-yet-mapped */ - /* memory. */ + /* memory. The address of any heap object is */ + /* less than GC_greatest_plausible_heap_addr. */ /* Handle nested references in a custom mark procedure. */ /* Check if obj is a valid object. If so, ensure that it is marked. */ @@ -155,8 +156,8 @@ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void * /* obj */, void ** /* src */); #define GC_MARK_AND_PUSH(obj, msp, lim, src) \ - ((GC_word)(obj) >= (GC_word)GC_least_plausible_heap_addr && \ - (GC_word)(obj) <= (GC_word)GC_greatest_plausible_heap_addr ? \ + ((GC_word)(obj) >= (GC_word)GC_least_plausible_heap_addr \ + && (GC_word)(obj) < (GC_word)GC_greatest_plausible_heap_addr ? \ GC_mark_and_push(obj, msp, lim, src) : (msp)) /* The size of the header added to objects allocated through the */ @@ -297,7 +297,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_kind_global(size_t lb, int k) } else { GC_ASSERT(0 == obj_link(op) || ((word)obj_link(op) - <= (word)GC_greatest_plausible_heap_addr + < (word)GC_greatest_plausible_heap_addr && (word)obj_link(op) >= (word)GC_least_plausible_heap_addr)); *opp = obj_link(op); @@ -612,15 +612,15 @@ GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, word tag = descr & GC_DS_TAGS; GC_STATIC_ASSERT(GC_DS_TAGS == 0x3); - switch(tag) { + switch (tag) { case GC_DS_LENGTH: /* Large length. */ /* Process part of the range to avoid pushing too much on the */ /* stack. */ - GC_ASSERT(descr < (word)GC_greatest_plausible_heap_addr + GC_ASSERT(descr <= (word)GC_greatest_plausible_heap_addr - (word)GC_least_plausible_heap_addr || (word)(current_p + descr) - <= (word)GC_least_plausible_heap_addr + < (word)GC_least_plausible_heap_addr || (word)current_p >= (word)GC_greatest_plausible_heap_addr); # ifdef PARALLEL_MARK # define SHARE_BYTES 2048 @@ -928,15 +928,14 @@ STATIC mse * GC_steal_mark_stack(mse * low, mse * high, mse * local, ++top; top -> mse_descr.w = descr; top -> mse_start = p -> mse_start; - GC_ASSERT((descr & GC_DS_TAGS) != GC_DS_LENGTH - || descr < (word)GC_greatest_plausible_heap_addr + GC_ASSERT((descr & GC_DS_TAGS) != GC_DS_LENGTH /* 0 */ + || descr <= (word)GC_greatest_plausible_heap_addr - (word)GC_least_plausible_heap_addr - || (word)(p->mse_start + descr) - <= (word)GC_least_plausible_heap_addr - || (word)p->mse_start + || (word)(p -> mse_start + descr) + < (word)GC_least_plausible_heap_addr + || (word)p -> mse_start >= (word)GC_greatest_plausible_heap_addr); - /* If this is a big object, count it as */ - /* size/256 + 1 objects. */ + /* If this is a big object, count it as size/256 + 1 objects. */ ++i; if ((descr & GC_DS_TAGS) == GC_DS_LENGTH) i += (int)(descr >> 8); } @@ -178,7 +178,7 @@ STATIC mse * GC_typed_mark_proc(word * addr, mse * mark_stack_ptr, LOAD_WORD_OR_CONTINUE(current, current_p); FIXUP_POINTER(current); - if (current >= (word)least_ha && current <= (word)greatest_ha) { + if (current >= (word)least_ha && current < (word)greatest_ha) { PUSH_CONTENTS((ptr_t)current, mark_stack_ptr, mark_stack_limit, current_p); } |