[svn:parrot] r48338 - branches/unshared_buffers/src/string
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Fri Aug 6 21:18:02 UTC 2010
Author: darbelo
Date: Fri Aug 6 21:18:02 2010
New Revision: 48338
URL: https://trac.parrot.org/parrot/changeset/48338
Log:
Redirect Parrot_str_copy to Parrot_str_clone
Modified:
branches/unshared_buffers/src/string/api.c
Modified: branches/unshared_buffers/src/string/api.c
==============================================================================
--- branches/unshared_buffers/src/string/api.c Fri Aug 6 21:17:51 2010 (r48337)
+++ branches/unshared_buffers/src/string/api.c Fri Aug 6 21:18:02 2010 (r48338)
@@ -383,25 +383,7 @@
Parrot_str_copy(PARROT_INTERP, ARGIN(const STRING *s))
{
ASSERT_ARGS(Parrot_str_copy)
- STRING *d;
- const int is_movable = PObj_is_movable_TESTALL(s);
-
- /* We set COW flag to avoid cloning buffer in compact_pool */
-
- d = Parrot_gc_new_string_header(interp,
- PObj_get_FLAGS(s) & ~PObj_constant_FLAG);
- STRUCT_COPY(d, s);
-
- /* Now check that buffer allocated from pool and affected by compacting */
- if (is_movable && Buffer_bufstart(s)) {
- /* If so, mark it as shared */
- INTVAL * const buffer_flags = Buffer_bufrefcountptr(d);
- *buffer_flags |= Buffer_shared_FLAG;
- }
-
- PARROT_ASSERT(is_movable == PObj_is_movable_TESTALL(d));
-
- return d;
+ return Parrot_str_clone(interp, s);
}
More information about the parrot-commits
mailing list