summaryrefslogtreecommitdiff
path: root/reclaim.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2006-11-17 06:37:13 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:38 +0200
commit986fc66d0b1d4c7b72bfbe8db7abf2a2ec69d472 (patch)
tree6a88610ddeb4dd14edbb795a395de88b3797636f /reclaim.c
parentec089234395eca2ffef3b343ea3f73219f296b20 (diff)
2006-11-16 Hans Boehm <Hans.Boehm@hp.com> (really mostly Bruce Hoult)
* doc/README.Mac: Clarify that this file is mostly obsolete. * reclaim.c (GC_print_free_list): New debug function.
Diffstat (limited to 'reclaim.c')
-rw-r--r--reclaim.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/reclaim.c b/reclaim.c
index 0ef7213..b1ff6b7 100644
--- a/reclaim.c
+++ b/reclaim.c
@@ -433,6 +433,25 @@ void GC_print_block_list()
(unsigned long)pstats.total_bytes);
}
+/* Currently for debugger use only: */
+void GC_print_free_list(int kind, size_t sz_in_granules)
+{
+ struct obj_kind * ok = &GC_obj_kinds[kind];
+ ptr_t flh = ok -> ok_freelist[sz_in_granules];
+ struct hblk *lastBlock = 0;
+ int n = 0;
+
+ while (flh){
+ struct hblk *block = HBLKPTR(flh);
+ if (block != lastBlock){
+ GC_printf("\nIn heap block at 0x%x:\n\t", block);
+ lastBlock = block;
+ }
+ GC_printf("%d: 0x%x;", ++n, flh);
+ flh = obj_link(flh);
+ }
+}
+
#endif /* NO_DEBUGGING */
/*