+void heap_update_references(rootset_t *rs, regioninfo_t *region, u4 offset)
+{
+ java_objectheader *o;
+ java_objectheader *ref;
+ java_objectheader **refptr;
+ u1* start;
+ u1* end;
+ int i;
+
+ GC_LOG( dolog("GC: Updating all references (offset=%x) ...", offset); );
+
+ start = region->base - offset;
+ end = region->ptr - offset;
+ GC_LOG( printf("Region previously was [ %p ; %p]\n", start, end); );
+
+ GC_LOG2( printf("updating in root-sets ..."); );
+
+ /* walk through all rootsets */
+ while (rs) {
+
+ /* walk through the references of this rootset */
+ for (i = 0; i < rs->refcount; i++) {
+
+ /* load the reference */
+ refptr = rs->refs[i];
+ ref = *( refptr );
+
+ GC_LOG2( printf("\troot pointer to %p\n", (void *) ref); );
+
+ /* update the references */
+ if (POINTS_INTO(ref, start, end))
+ *refptr = ((u1 *) ref) + offset;
+
+ }
+
+ /* skip to next rootset in chain */
+ rs = rs->next;
+
+ }
+
+
+ o = region->base;
+ while (o < region->ptr) {
+
+ GC_LOG2( printf("updating in %p ...\n", (void *) o); );
+
+ if (IS_ARRAY(o)) {
+
+ /* walk through the references of an Array */
+ FOREACH_ARRAY_REF(o,ref,refptr,