Moved emitting "GC_EVENT_START" and "GC_EVENT_END" events from "GC_maybe_gc" to ...
authorMassimiliano Mantione <massi@mono-cvs.ximian.com>
Fri, 23 May 2008 10:19:36 +0000 (10:19 -0000)
committerMassimiliano Mantione <massi@mono-cvs.ximian.com>
Fri, 23 May 2008 10:19:36 +0000 (10:19 -0000)
svn path=/trunk/mono/; revision=103867

libgc/ChangeLog
libgc/alloc.c

index 9cc106114156c1bfd42c06e32b2ff7652efcf1f6..10d43c1d3968366596cc31f53ab3ab0fa6660af0 100644 (file)
@@ -1,3 +1,7 @@
+2008-05-23  Massimiliano Mantione  <massi@ximian.com>
+       * alloc.c: Moved emitting "GC_EVENT_START" and "GC_EVENT_END" events
+       from "GC_maybe_gc" to "GC_try_to_collect_inner".
+
 2008-05-19  Zoltan Varga  <vargaz@gmail.com>
 
        * configure.in: Add two variables for passing CPPFLAGS/CFLAGS from the parent
index e8ab9ddfc5f9452a853f0bebe380585261ac2269..9ec6992352ad893b381dff712b37791359a183e8 100644 (file)
@@ -271,10 +271,6 @@ void GC_maybe_gc()
     static int n_partial_gcs = 0;
 
     if (GC_should_collect()) {
-       if (GC_notify_event)
-               GC_notify_event (GC_EVENT_START);
-           
-           
         if (!GC_incremental) {
             GC_gcollect_inner();
             n_partial_gcs = 0;
@@ -320,10 +316,6 @@ void GC_maybe_gc()
                GC_n_attempts++;
            }
        }
-       
-
-       if (GC_notify_event)
-               GC_notify_event (GC_EVENT_END);
     }
 }
 
@@ -340,6 +332,10 @@ GC_stop_func stop_func;
         CLOCK_TYPE start_time, current_time;
 #   endif
     if (GC_dont_gc) return FALSE;
+    
+    if (GC_notify_event)
+       GC_notify_event (GC_EVENT_START);
+    
     if (GC_incremental && GC_collection_in_progress()) {
 #   ifdef CONDPRINT
       if (GC_print_stats) {
@@ -402,6 +398,9 @@ GC_stop_func stop_func;
                    MS_TIME_DIFF(current_time,start_time));
       }
 #   endif
+    if (GC_notify_event)
+       GC_notify_event (GC_EVENT_END);
+      
     return(TRUE);
 }