[svn:parrot] r48767 - trunk/src/string

bacek at svn.parrot.org bacek at svn.parrot.org
Fri Sep 3 00:16:23 UTC 2010


Author: bacek
Date: Fri Sep  3 00:16:22 2010
New Revision: 48767
URL: https://trac.parrot.org/parrot/changeset/48767

Log:
Block GC in str_join to avoid premature collecting of temporary strings. Closes #1767.

Modified:
   trunk/src/string/api.c

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c	Thu Sep  2 13:38:04 2010	(r48766)
+++ trunk/src/string/api.c	Fri Sep  3 00:16:22 2010	(r48767)
@@ -3261,6 +3261,9 @@
     if (STRING_IS_NULL(j))
         j = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
 
+    /* We don't mark "chunks". So block GC here to avoid crash */
+    Parrot_block_GC_mark(interp);
+
     chunks = (STRING **)Parrot_gc_allocate_fixed_size_storage(interp,
         ar_len * sizeof (STRING *));
 
@@ -3346,6 +3349,8 @@
     Parrot_gc_free_fixed_size_storage(interp, ar_len * sizeof (STRING *),
         chunks);
 
+    Parrot_unblock_GC_mark(interp);
+
     return res;
 }
 


More information about the parrot-commits mailing list