[Mono-dev] Getting rid of String.InternalSetLength
Mark Probst
mark.probst at gmail.com
Thu Dec 3 13:02:31 EST 2009
SGen, our new garbage collector, doesn't explicitly store an object's
size but determines it via the object's vtable and, in the case of
arrays and strings, via the length field. String.InternalSetLength
changes that length field, which means that, from SGen's view, the
string's size changes. That's a problem because depending on an
object's size it is either stored in a regular heap section or, if it
is larger than a certain threshold, in the large object section (LOS).
SGen depends on being able to distinguish between the two, so it must
not happen that an object changes size, i.e. we have to get rid of
String.InternalSetLength, which is used by StringBuilder.
The attached patch fixes this problem, but of course it has to do more
copying. Does anybody object to this? Any alternatives?
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringlength.diff
Type: text/x-patch
Size: 1675 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091203/1f6bc88b/attachment.bin
More information about the Mono-devel-list
mailing list