Merge pull request #1952 from esdrubal/proc_name
[mono.git] / mono / metadata / cominterop.c
index 31d794f6b1fd4f696056d7b627cef95a131acc09..14585755bc58a8baa3055a169bbf410798945802 100644 (file)
@@ -23,7 +23,6 @@
 #include "metadata/appdomain.h"
 #include "metadata/reflection-internals.h"
 #include "mono/metadata/debug-helpers.h"
-#include "mono/metadata/threadpool.h"
 #include "mono/metadata/threads.h"
 #include "mono/metadata/monitor.h"
 #include "mono/metadata/metadata-internals.h"
@@ -873,7 +872,8 @@ mono_cominterop_get_native_wrapper (MonoMethod *method)
 
        g_assert (method);
 
-       cache = mono_marshal_get_cache (&method->klass->image->cominterop_wrapper_cache, mono_aligned_addr_hash, NULL);
+       cache = mono_marshal_get_cache (&mono_method_get_wrapper_cache (method)->cominterop_wrapper_cache, mono_aligned_addr_hash, NULL);
+
        if ((res = mono_marshal_find_in_cache (cache, method)))
                return res;
 
@@ -982,7 +982,9 @@ mono_cominterop_get_invoke (MonoMethod *method)
        MonoMethodBuilder *mb;
        MonoMethod *res;
        int i;
-       GHashTable* cache = mono_marshal_get_cache (&method->klass->image->cominterop_invoke_cache, mono_aligned_addr_hash, NULL);
+       GHashTable* cache;
+       
+       cache = mono_marshal_get_cache (&mono_method_get_wrapper_cache (method)->cominterop_invoke_cache, mono_aligned_addr_hash, NULL);
 
        g_assert (method);
 
@@ -3226,12 +3228,6 @@ cominterop_release_all_rcws (void)
 {
 }
 
-gboolean
-mono_marshal_free_ccw (MonoObject* object)
-{
-       return FALSE;
-}
-
 gpointer
 mono_string_to_bstr (MonoString *string_obj)
 {
@@ -3280,6 +3276,12 @@ mono_free_bstr (gpointer bstr)
 #endif
 }
 
+gboolean
+mono_marshal_free_ccw (MonoObject* object)
+{
+       return FALSE;
+}
+
 int
 ves_icall_System_Runtime_InteropServices_Marshal_AddRefInternal (gpointer pUnk)
 {