[sgen] Fix whole heap check.
authorMark Probst <mark.probst@gmail.com>
Sat, 2 Apr 2016 03:04:37 +0000 (20:04 -0700)
committerMark Probst <mark.probst@gmail.com>
Mon, 25 Jul 2016 18:06:55 +0000 (11:06 -0700)
mono/sgen/sgen-debug.c
mono/sgen/sgen-gc.c

index 6ee0694e8ee5ef22b92d93311b75b6dffab847c6..f073dc740648154853db6016d8a4564f7f137fe0 100644 (file)
@@ -429,15 +429,15 @@ missing_remset_spew (char *obj, char **slot)
 FIXME Flag missing remsets due to pinning as non fatal
 */
 #undef HANDLE_PTR
-#define HANDLE_PTR(ptr,obj)    do {    \
-               if (*(char**)ptr) {     \
+#define HANDLE_PTR(ptr,obj)    do {                                    \
+               if (*(char**)ptr) {                                     \
                        if (!is_valid_object_pointer (*(char**)ptr)) {  \
-                               bad_pointer_spew ((char*)obj, (char**)ptr);     \
-                       } else if (!sgen_ptr_in_nursery (obj) && sgen_ptr_in_nursery ((char*)*ptr)) {   \
-                               if (!sgen_get_remset ()->find_address ((char*)(ptr)) && !sgen_cement_lookup (*(ptr)) && (!allow_missing_pinned || !SGEN_OBJECT_IS_PINNED (*(ptr)))) \
-                               missing_remset_spew ((char*)obj, (char**)ptr);  \
-                       }       \
-        } \
+                               bad_pointer_spew ((char*)obj, (char**)ptr); \
+                       } else if (!sgen_ptr_in_nursery (obj) && sgen_ptr_in_nursery ((char*)*ptr)) { \
+                               if (!allow_missing_pinned && !SGEN_OBJECT_IS_PINNED (*(ptr)) && !sgen_get_remset ()->find_address ((char*)(ptr)) && !sgen_cement_lookup (*(ptr))) \
+                                       missing_remset_spew ((char*)obj, (char**)ptr); \
+                       }                                               \
+               }                                                       \
        } while (0)
 
 static void
index adfef93020d80def65e9bc4a0d112bbf75e081d3..1223ca01ba54c8461715c8f732bdc5bde0272fee 100644 (file)
@@ -1971,6 +1971,9 @@ major_finish_collection (SgenGrayQueue *gc_thread_gray_queue, const char *reason
        reset_heap_boundaries ();
        sgen_update_heap_boundaries ((mword)sgen_get_nursery_start (), (mword)sgen_get_nursery_end ());
 
+       if (whole_heap_check_before_collection)
+               sgen_check_whole_heap (FALSE);
+
        /* walk the pin_queue, build up the fragment list of free memory, unmark
         * pinned objects as we go, memzero() the empty fragments so they are ready for the
         * next allocations.
@@ -2170,9 +2173,6 @@ major_finish_concurrent_collection (gboolean forced)
        major_finish_collection (&gc_thread_gray_queue, "finishing", FALSE, -1, forced);
        sgen_gray_object_queue_dispose (&gc_thread_gray_queue);
 
-       if (whole_heap_check_before_collection)
-               sgen_check_whole_heap (FALSE);
-
        TV_GETTIME (total_end);
        gc_stats.major_gc_time += TV_ELAPSED (total_start, total_end) - TV_ELAPSED (last_minor_collection_start_tv, last_minor_collection_end_tv);