Use g_assertion_message instead of exit to kill an iOS app.
[mono.git] / mono / mini / tasklets.c
index a49be599e512a0f04c789c940411dd692e8e2843..417a55bbacfa5f0416fcfede4f10512e90a7023b 100644 (file)
@@ -19,7 +19,7 @@ internal_init (void)
 {
        if (keepalive_stacks)
                return;
-       MONO_GC_REGISTER_ROOT (keepalive_stacks);
+       MONO_GC_REGISTER_ROOT_PINNING (keepalive_stacks);
        keepalive_stacks = mono_g_hash_table_new (NULL, NULL);
 }
 
@@ -104,8 +104,10 @@ continuation_store (MonoContinuation *cont, int state, MonoException **e)
 
        if (cont->saved_stack && num_bytes <= cont->stack_alloc_size) {
                /* clear to avoid GC retention */
-               if (num_bytes < cont->stack_used_size)
+               if (num_bytes < cont->stack_used_size) {
                        memset ((char*)cont->saved_stack + num_bytes, 0, cont->stack_used_size - num_bytes);
+                       cont->stack_used_size = num_bytes;
+               }
        } else {
                tasklets_lock ();
                internal_init ();