X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fprofiler%2Fmono-profiler-iomap.c;h=bc0dd2c1b65cc1ad70d71a62ae54332c18750afa;hb=9f7554e973162348d8065e125dc5724e1b8e6238;hp=1b69c6a3e85728a0a4ec4ac92c4dfaedbbe105e3;hpb=9caf335edebb93ee1ff22d250ce44ff4dc2e6a5e;p=mono.git diff --git a/mono/profiler/mono-profiler-iomap.c b/mono/profiler/mono-profiler-iomap.c index 1b69c6a3e85..bc0dd2c1b65 100644 --- a/mono/profiler/mono-profiler-iomap.c +++ b/mono/profiler/mono-profiler-iomap.c @@ -5,6 +5,9 @@ * Marek Habersack * * Copyright (c) 2009 Novell, Inc (http://novell.com) + * + * Note: this profiler is completely unsafe wrt handling managed objects, + * don't use and don't copy code from here. */ #include "config.h" @@ -20,7 +23,7 @@ #include #include #include -#include +#include #define LOCATION_INDENT " " #define BACKTRACE_SIZE 64 @@ -205,7 +208,7 @@ static inline void print_report (const gchar *format, ...) static inline void append_report (GString **report, const gchar *format, ...) { -#if GLIB_CHECK_VERSION(2,14,0) +#if defined (_EGLIB_MAJOR) || GLIB_CHECK_VERSION(2,14,0) va_list ap; if (!*report) *report = g_string_new (""); @@ -225,7 +228,7 @@ static gboolean saved_strings_find_func (gpointer key, gpointer value, gpointer gchar *utf_str; guint32 hash; - if (!info || !saved || saved->string->length != info->len) + if (!info || !saved || mono_string_length (saved->string) != info->len) return FALSE; utf_str = mono_string_to_utf8 (saved->string); @@ -475,7 +478,7 @@ static void mono_portability_remember_alloc (MonoProfiler *prof, MonoObject *obj { if (klass != string_class) return; - mono_portability_remember_string (prof, mono_object_domain (obj), (MonoString*)obj); + mono_portability_remember_string (prof, mono_object_get_domain (obj), (MonoString*)obj); } static void mono_portability_iomap_event (MonoProfiler *prof, const char *report, const char *pathname, const char *new_pathname) @@ -529,7 +532,7 @@ void mono_profiler_startup (const char *desc) { MonoProfiler *prof = g_new0 (MonoProfiler, 1); - mono_mutex_init (&mismatched_files_section, NULL); + mono_mutex_init (&mismatched_files_section); prof->mismatched_files_hash = g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal); prof->saved_strings_hash = g_hash_table_new (NULL, NULL); prof->string_locations_hash = g_hash_table_new (mismatched_files_guint32_hash, mismatched_files_guint32_equal);