- mono_profiler_install (prof, profiler_shutdown);
- mono_profiler_install_runtime_initialized (runtime_initialized_cb);
- mono_profiler_install_iomap (mono_portability_iomap_event);
- mono_profiler_install_allocation (mono_portability_remember_alloc);
-
- mono_profiler_set_events ((MonoProfileFlags)(MONO_PROFILE_ALLOCATIONS | MONO_PROFILE_IOMAP_EVENTS));
+ MonoProfilerHandle handle = mono_profiler_install (prof);
+ mono_profiler_set_runtime_shutdown_callback (handle, profiler_shutdown);
+ mono_profiler_set_runtime_initialized_callback (handle, runtime_initialized_cb);
+ mono_profiler_set_iomap_report_callback (handle, mono_portability_iomap_event);
+ mono_profiler_enable_allocations ();
+ mono_profiler_set_gc_allocation_callback (handle, mono_portability_remember_alloc);