[svn:parrot] r46172 - branches/codestring/src/pmc

coke at svn.parrot.org coke at svn.parrot.org
Fri Apr 30 03:58:06 UTC 2010


Author: coke
Date: Fri Apr 30 03:58:06 2010
New Revision: 46172
URL: https://trac.parrot.org/parrot/changeset/46172

Log:
Instead of re-using the existing FSA, see if making a new one is more
friendly to memory usage.

(Was the old one hanging onto the old elements?)

Modified:
   branches/codestring/src/pmc/codestring.pmc

Modified: branches/codestring/src/pmc/codestring.pmc
==============================================================================
--- branches/codestring/src/pmc/codestring.pmc	Fri Apr 30 03:50:37 2010	(r46171)
+++ branches/codestring/src/pmc/codestring.pmc	Fri Apr 30 03:58:06 2010	(r46172)
@@ -225,12 +225,11 @@
 
 
     VTABLE void set_string_native(STRING *value) {
-        PMC *strings;
-        GET_ATTR_strings(INTERP, SELF, strings);
-
-        /* cache the result in our StringBuilder */
-        VTABLE_set_integer_native(INTERP, strings, 0);
+        /* create a new StringBuilder */
+        PMC *strings = pmc_new(INTERP, enum_class_ResizablePMCArray);
         VTABLE_push_string(INTERP, strings, value);
+
+        SET_ATTR_strings(INTERP, SELF, strings);
     }
 
 /*


More information about the parrot-commits mailing list