C# has interning via static methods on string  ( its even default in some
implementation i cant remember which ) , Im loose with terms but In this
case i meant interred  as in placed in a seperate heap which does not need
to be marked because it contains no references. This is done for string .
but if it sees a ref to a string object the marker  knows it doesnt need to
follow it.   I dont know the exact mechanism  but maybe something if ref in
stringheap range or if ref to type string . You are correct in market never
scans string but how is this done ... any custome string impl cant benefit
from this i think so if the CLR could avoid this scan for all types that
contain no references it would have been  good .


On Thu, Aug 29, 2013 at 3:26 AM, Jonathan S. Shapiro <[email protected]>wrote:

> On Wed, Aug 28, 2013 at 6:25 AM, Bennie Kloosteman <[email protected]>wrote:
>
>> It would be nice if immutable shallow types are interred in the special
>> heap where the  mark doesnt scan like strings but i doubt thats possible.
>>  Also the above is not possible in safe C# ( because of the fixed array)
>>
>
> Oh. Yes I do. You mean "intern" rather than "interred". Yes, there are a
> number of applications in which interned strings are a good idea, but
> perhaps not as many as you imagine. Unfortunately, the Object class in CLR
> and Java has mutable fields (notably the lock word), so the interning of
> strings is semantically visible.
>
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to