aboutsummaryrefslogtreecommitdiffstats
path: root/gc/reclaim.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-20 00:37:29 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-20 00:37:29 +0000
commit548b9dd8dbfa0dbe5247d9b4af7e388855beb506 (patch)
tree81b92ab0e12a687937e7948736fcb280dbc8d6c6 /gc/reclaim.c
parent[w3m-dev 02655] print version and compile options (diff)
downloadw3m-548b9dd8dbfa0dbe5247d9b4af7e388855beb506.tar.gz
w3m-548b9dd8dbfa0dbe5247d9b4af7e388855beb506.zip
sync with w3m-0.2.2-inu-1.1/gc
Diffstat (limited to '')
-rw-r--r--gc/reclaim.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/gc/reclaim.c b/gc/reclaim.c
index 78995f3..48db1e2 100644
--- a/gc/reclaim.c
+++ b/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 */