summaryrefslogtreecommitdiff
path: root/backgraph.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 20:09:54 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 20:09:54 +0400
commite35a4171fe47dfbf847e08988ea6cec4dfc8d124 (patch)
tree25f3501669fbf24a4b370c4f8b0c0701b1da4062 /backgraph.c
parentffa0c9ea38b3dd87e91b5ed2118c74002fed6782 (diff)
downloadbdwgc-e35a4171fe47dfbf847e08988ea6cec4dfc8d124.tar.gz
gc7.0alpha1 tarball importgc7_0alpha1
Diffstat (limited to 'backgraph.c')
-rw-r--r--backgraph.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/backgraph.c b/backgraph.c
index 0c512e2c..b4dbbb0f 100644
--- a/backgraph.c
+++ b/backgraph.c
@@ -254,12 +254,12 @@ static void add_edge(ptr_t p, ptr_t q)
}
}
-typedef void (*per_object_func)(ptr_t p, word n_words, word gc_descr);
+typedef void (*per_object_func)(ptr_t p, word n_bytes, word gc_descr);
static void per_object_helper(struct hblk *h, word fn)
{
hdr * hhdr = HDR(h);
- word sz = hhdr -> hb_sz;
+ size_t sz = hhdr -> hb_sz;
word descr = hhdr -> hb_descr;
per_object_func f = (per_object_func)fn;
int i = 0;
@@ -275,7 +275,7 @@ void GC_apply_to_each_object(per_object_func f)
GC_apply_to_all_blocks(per_object_helper, (word)f);
}
-static void reset_back_edge(ptr_t p, word n_words, word gc_descr)
+static void reset_back_edge(ptr_t p, word n_bytes, word gc_descr)
{
/* Skip any free list links, or dropped blocks */
if (GC_HAS_DEBUG_INFO(p)) {
@@ -311,20 +311,20 @@ static void reset_back_edge(ptr_t p, word n_words, word gc_descr)
}
}
-static void add_back_edges(ptr_t p, word n_words, word gc_descr)
+static void add_back_edges(ptr_t p, size_t n_bytes, word gc_descr)
{
word *currentp = (word *)(p + sizeof(oh));
/* For now, fix up non-length descriptors conservatively. */
if((gc_descr & GC_DS_TAGS) != GC_DS_LENGTH) {
- gc_descr = WORDS_TO_BYTES(n_words);
+ gc_descr = n_bytes;
}
while (currentp < (word *)(p + gc_descr)) {
word current = *currentp++;
FIXUP_POINTER(current);
if (current >= (word)GC_least_plausible_heap_addr &&
current <= (word)GC_greatest_plausible_heap_addr) {
- ptr_t target = GC_base((GC_PTR)current);
+ ptr_t target = GC_base((void *)current);
if (0 != target) {
add_edge(p, target);
}
@@ -369,7 +369,7 @@ static word backwards_height(ptr_t p)
word this_height;
if (GC_is_marked(q) && !(FLAG_MANY & (word)GET_OH_BG_PTR(p))) {
if (GC_print_stats)
- GC_printf2("Found bogus pointer from 0x%lx to 0x%lx\n", q, p);
+ GC_log_printf("Found bogus pointer from 0x%lx to 0x%lx\n", q, p);
/* Reachable object "points to" unreachable one. */
/* Could be caused by our lax treatment of GC descriptors. */
this_height = 1;
@@ -392,7 +392,7 @@ ptr_t GC_deepest_obj;
/* next GC. */
/* Set GC_max_height to be the maximum height we encounter, and */
/* GC_deepest_obj to be the corresponding object. */
-static void update_max_height(ptr_t p, word n_words, word gc_descr)
+static void update_max_height(ptr_t p, word n_bytes, word gc_descr)
{
if (GC_is_marked(p) && GC_HAS_DEBUG_INFO(p)) {
int i;
@@ -457,8 +457,8 @@ void GC_print_back_graph_stats(void)
GC_print_heap_obj(GC_deepest_obj);
}
if (GC_print_stats) {
- GC_printf1("Needed max total of %ld back-edge structs\n",
- GC_n_back_edge_structs);
+ GC_log_printf("Needed max total of %ld back-edge structs\n",
+ GC_n_back_edge_structs);
}
GC_apply_to_each_object(reset_back_edge);
GC_deepest_obj = 0;