[svn:parrot] r46234 - branches/codestring/src/pmc
coke at svn.parrot.org
coke at svn.parrot.org
Mon May 3 13:16:49 UTC 2010
Author: coke
Date: Mon May 3 13:16:49 2010
New Revision: 46234
URL: https://trac.parrot.org/parrot/changeset/46234
Log:
Don't fixup get/set string to deal with alternate storage - If you want
alternate storage, you need to override these 2 methods in your subclass'd PMC.
This avoids an issue building Test.pir on rakudo, sorear++ for reporting.
Modified:
branches/codestring/src/pmc/string.pmc
Modified: branches/codestring/src/pmc/string.pmc
==============================================================================
--- branches/codestring/src/pmc/string.pmc Mon May 3 08:57:12 2010 (r46233)
+++ branches/codestring/src/pmc/string.pmc Mon May 3 13:16:49 2010 (r46234)
@@ -126,16 +126,16 @@
Returns the string itself.
+Note: If your PMC-based subclass is not using the same string storage,
+you'll need to override this method.
+
=cut
*/
VTABLE STRING *get_string() {
STRING *str_val;
- if (SELF->vtable->base_type == enum_class_String)
- GET_ATTR_str_val(INTERP, SELF, str_val);
- else
- str_val = SELF.get_string();
+ GET_ATTR_str_val(INTERP, SELF, str_val);
return str_val;
}
@@ -201,6 +201,9 @@
Sets the value of the string to that of the specified C<string>.
+Note: If your PMC-based subclass is not using the same string storage,
+you'll need to override this method.
+
=cut
*/
@@ -218,10 +221,7 @@
Parrot_str_free_cstring(copy);
}
- if (SELF->vtable->base_type == enum_class_String)
- SET_ATTR_str_val(INTERP, SELF, value);
- else
- SELF.set_string_native(value);
+ SET_ATTR_str_val(INTERP, SELF, value);
}
/*
More information about the parrot-commits
mailing list