diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2004-08-13 23:05:36 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2004-08-14 00:05:36 +0100 |
commit | 4109fe8594fef15d5cb36d1019e5b7c95dbc45f6 (patch) | |
tree | 863181355c9339e1361dad10263a322aaabe426e /boehm-gc/allchblk.c | |
parent | f13bb1997aa840029740a52684fb9bcd20e834ab (diff) | |
download | gcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.zip gcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.tar.gz gcc-4109fe8594fef15d5cb36d1019e5b7c95dbc45f6.tar.bz2 |
configure.in (GCINCS): Don't use "boehm-cflags".
libjava:
2004-08-13 Bryce McKinlay <mckinlay@redhat.com>
* configure.in (GCINCS): Don't use "boehm-cflags". Instead, -I
boehm-gc's include dirs.
* configure: Rebuilt.
* include/boehm-gc.h: Include gc_config.h.
boehm-gc:
2004-08-13 Bryce McKinlay <mckinlay@redhat.com>
* configure.ac (gc_cflags): Add -Iinclude.
(AC_CONFIG_HEADERS): New. Configure gc_config.h header.
Don't write DEFS to boehm-cflags file.
* configure: Rebuilt.
* gcj_mlc.c: Check #ifdef GC_GCJ_SUPPORT after including headers.
* specific.c: Check #ifdef GC_LINUX_THREADS after including headers.
* include/gc_config_macros.h: Remove backward-compatibility
redefinitions of GC_ names.
* include/gc.h: Include <gc_config.h>.
2004-08-13 Bryce McKinlay <mckinlay@redhat.com>
Import Boehm GC version 6.3.
From-SVN: r85972
Diffstat (limited to 'boehm-gc/allchblk.c')
-rw-r--r-- | boehm-gc/allchblk.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/boehm-gc/allchblk.c b/boehm-gc/allchblk.c index 2b03939..793c468 100644 --- a/boehm-gc/allchblk.c +++ b/boehm-gc/allchblk.c @@ -111,7 +111,7 @@ void GC_print_hblkfreelist() for (i = 0; i <= N_HBLK_FLS; ++i) { h = GC_hblkfreelist[i]; # ifdef USE_MUNMAP - if (0 != h) GC_printf1("Free list %ld (Total size %ld):\n", + if (0 != h) GC_printf1("Free list %ld:\n", (unsigned long)i); # else if (0 != h) GC_printf2("Free list %ld (Total size %ld):\n", @@ -133,10 +133,12 @@ void GC_print_hblkfreelist() h = hhdr -> hb_next; } } - if (total_free != GC_large_free_bytes) { +# ifndef USE_MUNMAP + if (total_free != GC_large_free_bytes) { GC_printf1("GC_large_free_bytes = %lu (INCONSISTENT!!)\n", (unsigned long) GC_large_free_bytes); - } + } +# endif GC_printf1("Total of %lu bytes on free list\n", (unsigned long)total_free); } @@ -181,7 +183,7 @@ void GC_dump_regions() hhdr = HDR(p); GC_printf1("\t0x%lx ", (unsigned long)p); if (IS_FORWARDING_ADDR_OR_NIL(hhdr)) { - GC_printf1("Missing header!!\n", hhdr); + GC_printf1("Missing header!!(%ld)\n", hhdr); p += HBLKSIZE; continue; } @@ -375,9 +377,8 @@ void GC_unmap_old(void) if (!IS_MAPPED(hhdr)) continue; threshold = (unsigned short)(GC_gc_no - UNMAP_THRESHOLD); last_rec = hhdr -> hb_last_reclaimed; - if (last_rec > GC_gc_no - || last_rec < threshold && threshold < GC_gc_no - /* not recently wrapped */) { + if ((last_rec > GC_gc_no || last_rec < threshold) + && threshold < GC_gc_no /* not recently wrapped */) { sz = hhdr -> hb_sz; GC_unmap((ptr_t)h, sz); hhdr -> hb_flags |= WAS_UNMAPPED; @@ -422,6 +423,7 @@ void GC_merge_unmapped(void) } else { GC_remap((ptr_t)h, size); hhdr -> hb_flags &= ~WAS_UNMAPPED; + hhdr -> hb_last_reclaimed = nexthdr -> hb_last_reclaimed; } } else { /* Unmap any gap in the middle */ @@ -468,7 +470,11 @@ int index; if (total_size == bytes) return h; rest = (struct hblk *)((word)h + bytes); rest_hdr = GC_install_header(rest); - if (0 == rest_hdr) return(0); + if (0 == rest_hdr) { + /* This may be very bad news ... */ + WARN("Header allocation failed: Dropping block.\n", 0); + return(0); + } rest_hdr -> hb_sz = total_size - bytes; rest_hdr -> hb_flags = 0; # ifdef GC_ASSERTIONS @@ -784,6 +790,9 @@ signed_word size; size = HBLKSIZE * OBJ_SZ_TO_BLOCKS(size); GC_remove_counts(hbp, (word)size); hhdr->hb_sz = size; +# ifdef USE_MUNMAP + hhdr -> hb_last_reclaimed = GC_gc_no; +# endif /* Check for duplicate deallocation in the easy case */ if (HBLK_IS_FREE(hhdr)) { @@ -809,11 +818,17 @@ signed_word size; if (IS_MAPPED(prevhdr)) { GC_remove_from_fl(prevhdr, FL_UNKNOWN); prevhdr -> hb_sz += hhdr -> hb_sz; +# ifdef USE_MUNMAP + prevhdr -> hb_last_reclaimed = GC_gc_no; +# endif GC_remove_header(hbp); hbp = prev; hhdr = prevhdr; } } + /* FIXME: It is not clear we really always want to do these merges */ + /* with -DUSE_MUNMAP, since it updates ages and hence prevents */ + /* unmapping. */ GC_large_free_bytes += size; GC_add_to_fl(hbp, hhdr); |