X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=boehm-gc%2Fallchblk.c;h=1a1efc6b91b920dcdacdf1582394eb63ee461443;hb=c21723389538275d17f3892a24c50b035baef829;hp=793c468b928c4b8364c86d9937c01d2c28943650;hpb=4109fe8594fef15d5cb36d1019e5b7c95dbc45f6;p=gcc.git diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c index 793c468b928..1a1efc6b91b 100644 --- a/boehm-gc/allchblk.c +++ b/boehm-gc/allchblk.c @@ -285,8 +285,8 @@ int n; GET_HDR(hhdr -> hb_prev, phdr); phdr -> hb_next = hhdr -> hb_next; } + FREE_ASSERT(GC_free_bytes[index] >= hhdr -> hb_sz); INCR_FREE_BYTES(index, - (signed_word)(hhdr -> hb_sz)); - FREE_ASSERT(GC_free_bytes[index] >= 0); if (0 != hhdr -> hb_next) { hdr * nhdr; GC_ASSERT(!IS_FORWARDING_ADDR_OR_NIL(NHDR(hhdr))); @@ -590,8 +590,9 @@ int n; GET_HDR(hbp, hhdr); size_avail = hhdr->hb_sz; if (size_avail < size_needed) continue; - if (!GC_use_entire_heap - && size_avail != size_needed + if (size_avail != size_needed + && !GC_use_entire_heap + && !GC_dont_gc && USED_HEAP_SIZE >= GC_requested_heapsize && !TRUE_INCREMENTAL && GC_should_collect()) { # ifdef USE_MUNMAP @@ -608,7 +609,8 @@ int n; /* If we are deallocating lots of memory from */ /* finalizers, fail and collect sooner rather */ /* than later. */ - if (GC_finalizer_mem_freed > (GC_heapsize >> 4)) { + if (WORDS_TO_BYTES(GC_finalizer_mem_freed) + > (GC_heapsize >> 4)) { continue; } # endif /* !USE_MUNMAP */ @@ -698,7 +700,7 @@ int n; struct hblk * h; struct hblk * prev = hhdr -> hb_prev; - GC_words_wasted += total_size; + GC_words_wasted += BYTES_TO_WORDS(total_size); GC_large_free_bytes -= total_size; GC_remove_from_fl(hhdr, n); for (h = hbp; h < limit; h++) {