[svn:parrot] r48586 - in trunk/src: gc pmc string

nwellnhof at svn.parrot.org nwellnhof at svn.parrot.org
Fri Aug 20 18:13:02 UTC 2010


Author: nwellnhof
Date: Fri Aug 20 18:13:00 2010
New Revision: 48586
URL: https://trac.parrot.org/parrot/changeset/48586

Log:
Don't set live flag on new strings

Modified:
   trunk/src/gc/api.c
   trunk/src/pmc/stringbuilder.pmc
   trunk/src/string/api.c

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Fri Aug 20 14:54:31 2010	(r48585)
+++ trunk/src/gc/api.c	Fri Aug 20 18:13:00 2010	(r48586)
@@ -359,9 +359,9 @@
 =item C<STRING * Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags)>
 
 Returns a new C<STRING> header from the string pool or the constant string
-pool. Sets default flags on the string object: C<PObj_is_string_FLAG>,
-C<PObj_is_COWable_FLAG>, and C<PObj_live_FLAG> (for GC). Initializes the data
-field of the string buffer to C<NULL>.
+pool. Sets default flags on the string object: C<PObj_is_string_FLAG> and
+C<PObj_is_COWable_FLAG>. Initializes the data field of the string buffer to
+C<NULL>.
 
 =cut
 
@@ -381,7 +381,7 @@
 
     string->strstart        = NULL;
     PObj_get_FLAGS(string) |=
-        flags | PObj_is_string_FLAG | PObj_is_COWable_FLAG | PObj_live_FLAG;
+        flags | PObj_is_string_FLAG | PObj_is_COWable_FLAG;
 
     return string;
 }

Modified: trunk/src/pmc/stringbuilder.pmc
==============================================================================
--- trunk/src/pmc/stringbuilder.pmc	Fri Aug 20 14:54:31 2010	(r48585)
+++ trunk/src/pmc/stringbuilder.pmc	Fri Aug 20 18:13:00 2010	(r48586)
@@ -66,7 +66,7 @@
         buffer->encoding  = Parrot_default_encoding_ptr;
         buffer->charset   = Parrot_default_charset_ptr;
         /* We need all string flags here because we use this buffer in substr_str */
-        buffer->flags     = PObj_is_string_FLAG | PObj_live_FLAG | PObj_external_FLAG;
+        buffer->flags     = PObj_is_string_FLAG | PObj_external_FLAG;
         buffer->_bufstart = buffer->strstart = mem_gc_allocate_n_typed(INTERP,
                 initial_size, char);
         buffer->_buflen   = initial_size;
@@ -145,7 +145,7 @@
             STRING * const new_buffer = Parrot_unicode_charset_ptr->to_charset(interp, buffer);
             mem_gc_free(INTERP, buffer->_bufstart);
             STRUCT_COPY(buffer, new_buffer);
-            buffer->flags     = PObj_is_string_FLAG | PObj_live_FLAG | PObj_external_FLAG;
+            buffer->flags     = PObj_is_string_FLAG | PObj_external_FLAG;
 
             buffer->_bufstart = buffer->strstart = mem_gc_allocate_n_typed(INTERP,
                                                     new_buffer->_buflen, char);

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c	Fri Aug 20 14:54:31 2010	(r48585)
+++ trunk/src/string/api.c	Fri Aug 20 18:13:00 2010	(r48586)
@@ -353,8 +353,7 @@
 
     /* Clear COW flag. We own buffer */
     PObj_get_FLAGS(result)  = PObj_is_string_FLAG
-                            | PObj_is_COWable_FLAG
-                            | PObj_live_FLAG;
+                            | PObj_is_COWable_FLAG;
 
     /* Allocate new chunk of memory */
     Parrot_gc_allocate_string_storage(interp, result, alloc_size);
@@ -1304,8 +1303,7 @@
 
     /* Clear COW flag. We own buffer */
     PObj_get_FLAGS(dest) = PObj_is_string_FLAG
-                         | PObj_is_COWable_FLAG
-                         | PObj_live_FLAG;
+                         | PObj_is_COWable_FLAG;
 
             /* size            removed bytes            added bytes */
     buf_size = src->bufused - (end_byte - start_byte) + rep->bufused;


More information about the parrot-commits mailing list