On Saturday 28 April 2007 16:43:06 Mehmet Yavuz Selim Soyturk wrote:

> Next program makes a slurpy tailcall, and it causes a memory leak for me.

Confirmed.  Interestingly, the problem looks like a Key PMC somewhere gets 
garbage collected inappropriately.

I tried various tricks to mark the call_state's PMC as live, but nothing fixed 
anything except for this patch, which hides the problem.

Now I know that storing a PMC in a data structure that the GC doesn't check 
during mark and sweep is a problem, but liberal use of parrot_register_pmc() 
didn't fix things either.

-- c

=== src/inter_call.c
==================================================================
--- src/inter_call.c	(revision 3820)
+++ src/inter_call.c	(local)
@@ -1016,6 +1016,7 @@
         dest_ctx->results_signature = NULL;
     }
 
+    Parrot_block_DOD(interp);
     Parrot_init_arg_indexes_and_sig_pmc(interp, src_ctx, src_indexes, src_signature, &st.src);
     Parrot_init_arg_indexes_and_sig_pmc(interp, dest_ctx, dest_indexes, dest_signature, &st.dest);
     Parrot_process_args(interp, &st, param_or_result);
@@ -1023,6 +1024,7 @@
     /* If we created a slurpy, we had to DOD register it so it did not get
      * collected during arg processing; we'll now unregister it. */
     dod_unregister_pmc(interp, st.dest.slurp);
+    Parrot_unblock_DOD(interp);
 }
 
 /*

Reply via email to