[runtime] New profiler API.
[mono.git] / mono / metadata / dynamic-image.c
index b846347126cb0bf39f5baea7359c3544099cf384..211ba26266f050be64153fbbe19701171d265f6b 100644 (file)
@@ -314,14 +314,9 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
        else
                version = mono_get_runtime_info ()->runtime_version;
 
-#if HAVE_BOEHM_GC
-       /* The MonoGHashTable's need GC tracking */
-       image = (MonoDynamicImage *)GC_MALLOC (sizeof (MonoDynamicImage));
-#else
        image = g_new0 (MonoDynamicImage, 1);
-#endif
 
-       mono_profiler_module_event (&image->image, MONO_PROFILE_START_LOAD);
+       MONO_PROFILER_RAISE (image_loading, (&image->image));
        
        /*g_print ("created image %p\n", image);*/
        /* keep in sync with image.c */
@@ -380,7 +375,7 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c
        image->pe_kind = 0x1; /* ILOnly */
        image->machine = 0x14c; /* I386 */
        
-       mono_profiler_module_loaded (&image->image, MONO_PROFILE_OK);
+       MONO_PROFILER_RAISE (image_loaded, (&image->image));
 
        dynamic_images_lock ();
 
@@ -549,10 +544,5 @@ mono_dynamic_image_free (MonoDynamicImage *image)
 void
 mono_dynamic_image_free_image (MonoDynamicImage *image)
 {
-       /* See create_dynamic_mono_image () */
-#if HAVE_BOEHM_GC
-       /* Allocated using GC_MALLOC */
-#else
        g_free (image);
-#endif
 }