}
/* We try to mark with the world stopped. */
/* If we run out of time, this turns into */
- /* incremental marking. */
+ /* incremental marking. */
# ifndef NO_CLOCK
if (GC_time_limit != GC_TIME_UNLIMITED) { GET_TIME(GC_start_time); }
# endif
unsigned bit_no = MARK_BIT_NO((ptr_t)q - (ptr_t)h, sz);
if (mark_bit_from_hdr(hhdr, bit_no)) {
- size_t n_marks = hhdr -> hb_n_marks - 1;
+ size_t n_marks = hhdr -> hb_n_marks;
+
+ GC_ASSERT(n_marks != 0);
clear_mark_bit_from_hdr(hhdr, bit_no);
+ n_marks--;
# ifdef PARALLEL_MARK
/* Appr. count, don't decrement to zero! */
if (0 != n_marks || !GC_parallel) {
word bit_no = MARK_BIT_NO((ptr_t)p - (ptr_t)h, hhdr -> hb_sz);
if (mark_bit_from_hdr(hhdr, bit_no)) {
- size_t n_marks;
+ size_t n_marks = hhdr -> hb_n_marks;
+
+ GC_ASSERT(n_marks != 0);
clear_mark_bit_from_hdr(hhdr, bit_no);
- n_marks = hhdr -> hb_n_marks - 1;
+ n_marks--;
# ifdef PARALLEL_MARK
if (n_marks != 0 || !GC_parallel)
hhdr -> hb_n_marks = n_marks;