Merge pull request #2720 from mono/fix-39325
[mono.git] / mono / profiler / mono-profiler-iomap.c
index cfefcf6dae7ae3564a34652d3de1cb973333983e..445e1bf1f893cab64898eed096e0c072ea009b1e 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Note: this profiler is completely unsafe wrt handling managed objects,
  * don't use and don't copy code from here.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
 #include "config.h"
 
@@ -112,7 +113,7 @@ static void mismatched_stats_foreach_func (gpointer key, gpointer value, gpointe
                return;
        }
 
-       location = g_hash_table_lookup (prof->string_locations_hash, &hash);
+       location = (StringLocation *)g_hash_table_lookup (prof->string_locations_hash, &hash);
        while (location) {
                if (location->hint && strlen (location->hint) > 0) {
                        if (!bannerShown) {
@@ -195,7 +196,7 @@ static inline void print_report (const gchar *format, ...)
        vfprintf (stdout, format, ap);
        fprintf (stdout, "\n");
        va_end (ap);
-       klass = mono_class_from_name (mono_get_corlib (), "System", "Environment");
+       klass = mono_class_load_from_name (mono_get_corlib (), "System", "Environment");
        mono_class_init (klass);
        prop = mono_class_get_property_from_name (klass, "StackTrace");
        str = (MonoString*)mono_property_get_value (prop, NULL, NULL, NULL);
@@ -243,7 +244,7 @@ static gboolean saved_strings_find_func (gpointer key, gpointer value, gpointer
 
 static inline void store_string_location (MonoProfiler *prof, const gchar *string, guint32 hash, size_t len)
 {
-       StringLocation *location = g_hash_table_lookup (prof->string_locations_hash, &hash);
+       StringLocation *location = (StringLocation *)g_hash_table_lookup (prof->string_locations_hash, &hash);
        SavedString *saved;
        SavedStringFindInfo info;
        guint32 *hashptr;
@@ -542,5 +543,5 @@ void mono_profiler_startup (const char *desc)
        mono_profiler_install_iomap (mono_portability_iomap_event);
        mono_profiler_install_allocation (mono_portability_remember_alloc);
 
-       mono_profiler_set_events (MONO_PROFILE_ALLOCATIONS | MONO_PROFILE_IOMAP_EVENTS);
+       mono_profiler_set_events ((MonoProfileFlags)(MONO_PROFILE_ALLOCATIONS | MONO_PROFILE_IOMAP_EVENTS));
 }