diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2015-05-17 21:03:22 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2015-05-17 21:03:22 +0300 |
commit | 7aba59b5853330c9368bc16dd606e1617c704334 (patch) | |
tree | 36edbe13bebd4957cd9c2cddc78aada6d186e0b7 /misc.c | |
parent | daa6cd949f6d374528b7a1305ffaff2bb094a66d (diff) | |
parent | dcfbceb89f1d2dd9fa334467d19d5422fdc3e2ca (diff) | |
download | bdwgc-7aba59b5853330c9368bc16dd606e1617c704334.tar.gz |
Merge branch 'profiling-callbacks'
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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). */ |