Author: miguel
Date: 2005-03-15 16:36:10 -0500 (Tue, 15 Mar 2005)
New Revision: 41865

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/mini.c
Log:
2005-03-15  Miguel de Icaza  <[EMAIL PROTECTED]>

        * mini.c: As discussed, make the code actually free the delegate
        thunk now, to enable the debugging of delegate problems, use
        MONO_DEBUG=1 when running Mono. 

        This takes also care of parts of the leaks as seen by Joe.

Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2005-03-15 21:34:04 UTC (rev 41864)
+++ trunk/mono/mono/mini/ChangeLog      2005-03-15 21:36:10 UTC (rev 41865)
@@ -1,3 +1,11 @@
+2005-03-15  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * mini.c: As discussed, make the code actually free the delegate
+       thunk now, to enable the debugging of delegate problems, use
+       MONO_DEBUG=1 when running Mono. 
+
+       This takes also care of parts of the leaks as seen by Joe.
+
 2005-03-15  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * mini-amd64.c (mono_arch_setup_jit_tls_data): Enable 

Modified: trunk/mono/mono/mini/mini.c
===================================================================
--- trunk/mono/mono/mini/mini.c 2005-03-15 21:34:04 UTC (rev 41864)
+++ trunk/mono/mono/mini/mini.c 2005-03-15 21:36:10 UTC (rev 41865)
@@ -147,6 +147,9 @@
 
 static GHashTable *jit_icall_name_hash = NULL;
 
+/* If set to true, the environment variable MONO_DEBUG is set */
+static int mono_env_debug = 0;
+
 /*
  * Address of the trampoline code.  This is used by the debugger to check
  * whether a method is a trampoline.
@@ -9391,7 +9394,7 @@
 
 #ifdef MONO_ARCH_HAVE_INVALIDATE_METHOD
        /* FIXME: only enable this with a env var */
-       if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
+       if (mono_env_debug && method->wrapper_type == 
MONO_WRAPPER_NATIVE_TO_MANAGED) {
                /*
                 * Instead of freeing the code, change it to call an error 
routine
                 * so people can fix their code.
@@ -9792,6 +9795,9 @@
 
        if (!g_thread_supported ())
                g_thread_init (NULL);
+
+       if (getenv ("MONO_DEBUG") != NULL)
+               mono_env_debug = 1;
        
        MONO_GC_PRE_INIT ();
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to