aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/reclaim.c
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>2001-10-16 09:01:40 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2001-10-16 10:01:40 +0100
commit4c7726b172c35bd078bb0f88025670ffddd94a92 (patch)
tree483dc5098530e605b23e445c94fcdfdfec0d9b23 /boehm-gc/reclaim.c
parent107abb2f61f6e53ebb7aa05b78fdd9234ee7877c (diff)
downloadgcc-4c7726b172c35bd078bb0f88025670ffddd94a92.zip
gcc-4c7726b172c35bd078bb0f88025670ffddd94a92.tar.gz
gcc-4c7726b172c35bd078bb0f88025670ffddd94a92.tar.bz2
Makefile.am, [...]: Imported GC 6.1 Alpha 1 and merged local changes.
* Makefile.am, acinclude.m4, configure.in: Imported GC 6.1 Alpha 1 and merged local changes. From-SVN: r46283
Diffstat (limited to 'boehm-gc/reclaim.c')
-rw-r--r--boehm-gc/reclaim.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/boehm-gc/reclaim.c b/boehm-gc/reclaim.c
index 78995f3..48db1e2 100644
--- a/boehm-gc/reclaim.c
+++ b/boehm-gc/reclaim.c
@@ -702,7 +702,8 @@ COUNT_DECL
if (report_if_found) {
GC_reclaim_check(hbp, hhdr, sz);
} else {
- *flh = GC_reclaim_generic(hbp, hhdr, sz, ok -> ok_init,
+ *flh = GC_reclaim_generic(hbp, hhdr, sz,
+ (ok -> ok_init || GC_debugging_started),
*flh MEM_FOUND_ADDR);
}
}
@@ -774,8 +775,12 @@ COUNT_DECL
/* Routines to gather and print heap block info */
/* intended for debugging. Otherwise should be called */
/* with lock. */
-static size_t number_of_blocks;
-static size_t total_bytes;
+
+struct Print_stats
+{
+ size_t number_of_blocks;
+ size_t total_bytes;
+};
#ifdef USE_MARK_BYTES
@@ -834,25 +839,30 @@ hdr * hhdr;
{
register hdr * hhdr = HDR(h);
register size_t bytes = WORDS_TO_BYTES(hhdr -> hb_sz);
+ struct Print_stats *ps;
GC_printf3("(%lu:%lu,%lu)", (unsigned long)(hhdr -> hb_obj_kind),
(unsigned long)bytes,
(unsigned long)(GC_n_set_marks(hhdr)));
bytes += HBLKSIZE-1;
bytes &= ~(HBLKSIZE-1);
- total_bytes += bytes;
- number_of_blocks++;
+
+ ps = (struct Print_stats *)dummy;
+ ps->total_bytes += bytes;
+ ps->number_of_blocks++;
}
void GC_print_block_list()
{
+ struct Print_stats pstats;
+
GC_printf0("(kind(0=ptrfree,1=normal,2=unc.,3=stubborn):size_in_bytes, #_marks_set)\n");
- number_of_blocks = 0;
- total_bytes = 0;
- GC_apply_to_all_blocks(GC_print_block_descr, (word)0);
+ pstats.number_of_blocks = 0;
+ pstats.total_bytes = 0;
+ GC_apply_to_all_blocks(GC_print_block_descr, (word)&pstats);
GC_printf2("\nblocks = %lu, bytes = %lu\n",
- (unsigned long)number_of_blocks,
- (unsigned long)total_bytes);
+ (unsigned long)pstats.number_of_blocks,
+ (unsigned long)pstats.total_bytes);
}
#endif /* NO_DEBUGGING */