From: hboehm Date: Wed, 20 Feb 2008 22:02:46 +0000 (+0000) Subject: 2008-02-20 Hans Boehm X-Git-Tag: gc7_1alpha3-20080220~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b381c0a0d59bb2cffde9a8a6f4919c5454ac9e84;p=gc 2008-02-20 Hans Boehm * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP, and refine assertions to handle huge unmergable blocks. (GC_allochblk_nth): Add comment. --- diff --git a/ChangeLog b/ChangeLog index b1f14158..979b05ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-20 Hans Boehm + + * allchblk.c (add_to_fl): disable assertions with USE_MUNMAP, + and refine assertions to handle huge unmergable blocks. + (GC_allochblk_nth): Add comment. + 2008-02-20 Hans Boehm * include/private/gcconfig.h: Add misssing FREEBSD macro diff --git a/allchblk.c b/allchblk.c index ed6a60b1..8d326e53 100644 --- a/allchblk.c +++ b/allchblk.c @@ -363,13 +363,16 @@ void GC_add_to_fl(struct hblk *h, hdr *hhdr) int index = GC_hblk_fl_from_blocks(divHBLKSZ(hhdr -> hb_sz)); struct hblk *second = GC_hblkfreelist[index]; hdr * second_hdr; -# ifdef GC_ASSERTIONS +# if defined(GC_ASSERTIONS) && !defined(USE_MUNMAP) struct hblk *next = (struct hblk *)((word)h + hhdr -> hb_sz); hdr * nexthdr = HDR(next); struct hblk *prev = GC_free_block_ending_at(h); hdr * prevhdr = HDR(prev); - GC_ASSERT(nexthdr == 0 || !HBLK_IS_FREE(nexthdr) || !IS_MAPPED(nexthdr)); - GC_ASSERT(prev == 0 || !HBLK_IS_FREE(prevhdr) || !IS_MAPPED(prevhdr)); + GC_ASSERT(nexthdr == 0 || !HBLK_IS_FREE(nexthdr) + || (signed_word)GC_heapsize < 0); + /* In the last case, blocks may be too large to merge. */ + GC_ASSERT(prev == 0 || !HBLK_IS_FREE(prevhdr) + || (signed_word)GC_heapsize < 0); # endif GC_ASSERT(((hhdr -> hb_sz) & (HBLKSIZE-1)) == 0); GC_hblkfreelist[index] = h; @@ -765,6 +768,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, GC_bool may_split) if (!IS_MAPPED(hhdr)) { GC_remap((ptr_t)hbp, hhdr -> hb_sz); hhdr -> hb_flags &= ~WAS_UNMAPPED; + /* Note: This may leave adjacent, mapped free blocks. */ } # endif /* hbp may be on the wrong freelist; the parameter n */