summaryrefslogtreecommitdiff
path: root/byterun/major_gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/major_gc.c')
-rw-r--r--byterun/major_gc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/byterun/major_gc.c b/byterun/major_gc.c
index 006da8471e..6a273b9736 100644
--- a/byterun/major_gc.c
+++ b/byterun/major_gc.c
@@ -149,7 +149,6 @@ static void mark_slice (intnat work)
int marking_closure = 0;
#endif
- if (caml_major_slice_begin_hook != NULL) (*caml_major_slice_begin_hook) ();
caml_gc_message (0x40, "Marking %ld words\n", work);
caml_gc_message (0x40, "Subphase = %ld\n", caml_gc_subphase);
gray_vals_ptr = gray_vals_cur;
@@ -322,7 +321,6 @@ static void mark_slice (intnat work)
}
}
gray_vals_cur = gray_vals_ptr;
- if (caml_major_slice_end_hook != NULL) (*caml_major_slice_end_hook) ();
}
static void sweep_slice (intnat work)
@@ -330,7 +328,6 @@ static void sweep_slice (intnat work)
char *hp;
header_t hd;
- if (caml_major_slice_begin_hook != NULL) (*caml_major_slice_begin_hook) ();
caml_gc_message (0x40, "Sweeping %ld words\n", work);
while (work > 0){
if (caml_gc_sweep_hp < limit){
@@ -369,7 +366,6 @@ static void sweep_slice (intnat work)
}
}
}
- if (caml_major_slice_end_hook != NULL) (*caml_major_slice_end_hook) ();
}
/* The main entry point for the GC. Called after each minor GC.
@@ -424,6 +420,8 @@ intnat caml_major_collection_slice (intnat howmuch)
This slice will either mark MS words or sweep SS words.
*/
+ if (caml_major_slice_begin_hook != NULL) (*caml_major_slice_begin_hook) ();
+
if (caml_gc_phase == Phase_idle) start_cycle ();
p = (double) caml_allocated_words * 3.0 * (100 + caml_percent_free)
@@ -471,6 +469,7 @@ intnat caml_major_collection_slice (intnat howmuch)
caml_allocated_words = 0;
caml_dependent_allocated = 0;
caml_extra_heap_resources = 0.0;
+ if (caml_major_slice_end_hook != NULL) (*caml_major_slice_end_hook) ();
return computed_work;
}