summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2015-05-17 21:03:22 +0300
committerIvan Maidanski <ivmai@mail.ru>2015-05-17 21:03:22 +0300
commit7aba59b5853330c9368bc16dd606e1617c704334 (patch)
tree36edbe13bebd4957cd9c2cddc78aada6d186e0b7 /misc.c
parentdaa6cd949f6d374528b7a1305ffaff2bb094a66d (diff)
parentdcfbceb89f1d2dd9fa334467d19d5422fdc3e2ca (diff)
downloadbdwgc-7aba59b5853330c9368bc16dd606e1617c704334.tar.gz
Merge branch 'profiling-callbacks'
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 7db5a88c..93e8665c 100644
--- a/misc.c
+++ b/misc.c
@@ -2074,6 +2074,27 @@ GC_API GC_on_heap_resize_proc GC_CALL GC_get_on_heap_resize(void)
return fn;
}
+GC_INNER GC_on_collection_event_proc GC_on_collection_event = 0;
+
+GC_API void GC_CALL GC_set_on_collection_event(GC_on_collection_event_proc fn)
+{
+ /* fn may be 0 (means no event notifier). */
+ DCL_LOCK_STATE;
+ LOCK();
+ GC_on_collection_event = fn;
+ UNLOCK();
+}
+
+GC_API GC_on_collection_event_proc GC_CALL GC_get_on_collection_event(void)
+{
+ GC_on_collection_event_proc fn;
+ DCL_LOCK_STATE;
+ LOCK();
+ fn = GC_on_collection_event;
+ UNLOCK();
+ return fn;
+}
+
GC_API void GC_CALL GC_set_finalizer_notifier(GC_finalizer_notifier_proc fn)
{
/* fn may be 0 (means no finalizer notifier). */