[runtime] New profiler API.
[mono.git] / mono / metadata / loader.c
index d9781cbdfdd8e849e0cc4d742fb4665eb6cbd4c9..56c3572e76e9137f7140bbed28329fd0c871c0dd 100644 (file)
@@ -1901,11 +1901,10 @@ mono_get_method_constrained_checked (MonoImage *image, guint32 token, MonoClass
 void
 mono_free_method  (MonoMethod *method)
 {
-       if (mono_profiler_get_events () & MONO_PROFILE_METHOD_EVENTS)
-               mono_profiler_method_free (method);
+       MONO_PROFILER_RAISE (method_free, (method));
        
        /* FIXME: This hack will go away when the profiler will support freeing methods */
-       if (mono_profiler_get_events () != MONO_PROFILE_NONE)
+       if (G_UNLIKELY (mono_profiler_installed ()))
                return;
        
        if (method->signature) {