summaryrefslogtreecommitdiff
path: root/backgraph.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-11-08 01:29:55 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:44 +0200
commit9823a3a516cd41b266c1fd3291787b3fc0d243a8 (patch)
tree486d9220921ce4c814ccfb0f032ab0e538dd97df /backgraph.c
parent509a93c07c5df62dd966b2d8c524ff93e71c282f (diff)
2008-11-07 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
(Mostly improves LLP64 support.) * backgraph.c, checksums.c, dbg_mlc.c, finalize.c, mark.c, misc.c, reclaim.c: Changed some int and long type to word or size_t (and vice versa where appropriate) * gcj_mlc.c, include/private/dbg_mlc.h, include/private/gcconfig.h, include/private/thread_local_alloc.h, mark.c, misc.c, thread_local_alloc.c, win32_threads.c: Added intermediate casts to word type when casting from int to pointer (or pointer to int, or data pointer to code pointer) - just to remove the corresponding compiler warning. * ptr_chck.c (GC_is_visible): cast int const to word type to prevent left shift overflow. * os_dep.c: change the type of GC_mem_top_down global var (containing a flag) to DWORD. * include/gc_config_macros.h: define GC_SOLARIS_THREADS if GC_THREADS is defined on SunOS x86_64. * misc.c (GC_init_size_map): Ifdef out GC_ASSERT as a workaround for VC++ 2008 amd64 (v15.00.21022.08 for x64) compiler bug (the compiler gets hung if invoked with -Ox -D ALL_INTERIOR_POINTERS -D GC_ASSERTIONS) * backgraph.c: cast GC_gc_no value to unsigned short when assigned/compared to height_gc_no field of back_edges. * os_dep.c (GC_remove_protection): Add ARGSUSED. * win32_threads.c (GC_thread_exit_proc): Remove unused local var. * mark.c (GC_check_dirty): Move declaration out of func body.
Diffstat (limited to 'backgraph.c')
-rw-r--r--backgraph.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/backgraph.c b/backgraph.c
index 17c9293..233400a 100644
--- a/backgraph.c
+++ b/backgraph.c
@@ -151,7 +151,7 @@ static void push_in_progress(ptr_t p)
static GC_bool is_in_progress(ptr_t p)
{
- int i;
+ size_t i;
for (i = 0; i < n_in_progress; ++i) {
if (in_progress_space[i] == p) return TRUE;
}
@@ -179,8 +179,9 @@ static void pop_in_progress(ptr_t p)
} else { \
back_edges *orig_be_ = (back_edges *)((word)q & ~FLAG_MANY); \
back_edges *be_ = orig_be_; \
- int total_, local_; \
- int n_edges_ = be_ -> n_edges; \
+ int local_; \
+ word total_; \
+ word n_edges_ = be_ -> n_edges; \
for (total_ = 0, local_ = 0; total_ < n_edges_; ++local_, ++total_) { \
if (local_ == MAX_IN) { \
be_ = be_ -> cont; \
@@ -206,7 +207,7 @@ static void ensure_struct(ptr_t p)
be -> edges[0] = old_back_ptr;
}
be -> height = HEIGHT_UNKNOWN;
- be -> height_gc_no = GC_gc_no - 1;
+ be -> height_gc_no = (unsigned short)(GC_gc_no - 1);
GC_ASSERT(be >= back_edge_space);
SET_OH_BG_PTR(p, (word)be | FLAG_MANY);
}
@@ -274,8 +275,8 @@ static void per_object_helper(struct hblk *h, word fn)
do {
f((ptr_t)(h -> hb_body + i), sz, descr);
- i += sz;
- } while (i + sz <= BYTES_TO_WORDS(HBLKSIZE));
+ i += (int)sz;
+ } while (i + (int)sz <= BYTES_TO_WORDS(HBLKSIZE));
}
void GC_apply_to_each_object(per_object_func f)
@@ -367,7 +368,7 @@ static word backwards_height(ptr_t p)
return result;
}
be = (back_edges *)((word)back_ptr & ~FLAG_MANY);
- if (be -> height >= 0 && be -> height_gc_no == GC_gc_no)
+ if (be -> height >= 0 && be -> height_gc_no == (unsigned short)GC_gc_no)
return be -> height;
/* Ignore back edges in DFS */
if (be -> height == HEIGHT_IN_PROGRESS) return 0;
@@ -387,7 +388,7 @@ static word backwards_height(ptr_t p)
if (this_height >= result) result = this_height + 1;
});
be -> height = result;
- be -> height_gc_no = GC_gc_no;
+ be -> height_gc_no = (unsigned short)GC_gc_no;
return result;
}
@@ -437,7 +438,7 @@ static void update_max_height(ptr_t p, size_t n_bytes, word gc_descr)
}
be -> flags |= RETAIN;
be -> height = p_height;
- be -> height_gc_no = GC_gc_no;
+ be -> height_gc_no = (unsigned short)GC_gc_no;
}
if (p_height > GC_max_height) {
GC_max_height = p_height;