aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/checksums.c
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2004-08-13 23:05:36 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2004-08-14 00:05:36 +0100
commit4109fe8594fef15d5cb36d1019e5b7c95dbc45f6 (patch)
tree863181355c9339e1361dad10263a322aaabe426e /boehm-gc/checksums.c
parentf13bb1997aa840029740a52684fb9bcd20e834ab (diff)
downloadgcc-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/checksums.c')
-rw-r--r--boehm-gc/checksums.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/boehm-gc/checksums.c b/boehm-gc/checksums.c
index 121c36d4..57a6ebc 100644
--- a/boehm-gc/checksums.c
+++ b/boehm-gc/checksums.c
@@ -13,14 +13,14 @@
/* Boehm, March 29, 1995 12:51 pm PST */
# ifdef CHECKSUMS
-# include "gc_priv.h"
+# include "private/gc_priv.h"
/* This is debugging code intended to verify the results of dirty bit */
/* computations. Works only in a single threaded environment. */
/* We assume that stubborn objects are changed only when they are */
/* enabled for writing. (Certain kinds of writing are actually */
/* safe under other conditions.) */
-# define NSUMS 2000
+# define NSUMS 10000
# define OFFSET 0x10000
@@ -29,7 +29,7 @@ typedef struct {
word old_sum;
word new_sum;
struct hblk * block; /* Block to which this refers + OFFSET */
- /* to hide it from colector. */
+ /* to hide it from collector. */
} page_entry;
page_entry GC_sums [NSUMS];
@@ -76,12 +76,13 @@ int index;
{
page_entry *pe = GC_sums + index;
register hdr * hhdr = HDR(h);
+ struct hblk *b;
if (pe -> block != 0 && pe -> block != h + OFFSET) ABORT("goofed");
pe -> old_sum = pe -> new_sum;
pe -> new_sum = GC_checksum(h);
# if !defined(MSWIN32) && !defined(MSWINCE)
- if (pe -> new_sum != 0 && !GC_page_was_ever_dirty(h)) {
+ if (pe -> new_sum != 0x80000000 && !GC_page_was_ever_dirty(h)) {
GC_printf1("GC_page_was_ever_dirty(0x%lx) is wrong\n",
(unsigned long)h);
}
@@ -91,13 +92,19 @@ int index;
} else {
GC_n_clean++;
}
- if (pe -> new_valid && pe -> old_sum != pe -> new_sum) {
+ b = h;
+ while (IS_FORWARDING_ADDR_OR_NIL(hhdr) && hhdr != 0) {
+ b -= (word)hhdr;
+ hhdr = HDR(b);
+ }
+ if (pe -> new_valid
+ && hhdr != 0 && hhdr -> hb_descr != 0 /* may contain pointers */
+ && pe -> old_sum != pe -> new_sum) {
if (!GC_page_was_dirty(h) || !GC_page_was_ever_dirty(h)) {
/* Set breakpoint here */GC_n_dirty_errors++;
}
# ifdef STUBBORN_ALLOC
- if (!IS_FORWARDING_ADDR_OR_NIL(hhdr)
- && hhdr -> hb_map != GC_invalid_map
+ if ( hhdr -> hb_map != GC_invalid_map
&& hhdr -> hb_obj_kind == STUBBORN
&& !GC_page_was_changed(h)
&& !GC_on_free_list(h)) {
@@ -120,26 +127,17 @@ word dummy;
register hdr * hhdr = HDR(h);
register bytes = WORDS_TO_BYTES(hhdr -> hb_sz);
- bytes += HDR_BYTES + HBLKSIZE-1;
+ bytes += HBLKSIZE-1;
bytes &= ~(HBLKSIZE-1);
GC_bytes_in_used_blocks += bytes;
}
void GC_check_blocks()
{
- word bytes_in_free_blocks = 0;
- struct hblk * h = GC_hblkfreelist;
- hdr * hhdr = HDR(h);
- word sz;
+ word bytes_in_free_blocks = GC_large_free_bytes;
GC_bytes_in_used_blocks = 0;
GC_apply_to_all_blocks(GC_add_block, (word)0);
- while (h != 0) {
- sz = hhdr -> hb_sz;
- bytes_in_free_blocks += sz;
- h = hhdr -> hb_next;
- hhdr = HDR(h);
- }
GC_printf2("GC_bytes_in_used_blocks = %ld, bytes_in_free_blocks = %ld ",
GC_bytes_in_used_blocks, bytes_in_free_blocks);
GC_printf1("GC_heapsize = %ld\n", GC_heapsize);