News for hackers. Stuff that matters.
Re:CoreCLR is now open source by munificent on Tuesday February 03, 2015 @03:38PM (#8993180)
Presumably because it's not worth the memory hit to store the hash.
Re:CoreCLR is now open source by DoggettCK on Tuesday February 03, 2015 @03:47PM (#8993237)
That was my assumption, too. They do memoize the length, but I'm sure those bytes add up, having run into OutOfMemoryExceptions building huge amounts of strings before.
Re:CoreCLR is now open source by reddiric on Tuesday February 03, 2015 @04:00PM (#8993327)
Strings know their length in the CLR because they are represented as BSTRs

http://blogs.msdn.com/b/ericlippert/archive/2011/07/19/strin...

This lets them interoperate with OLE Automation.

Re:CoreCLR is now open source by porges on Tuesday February 03, 2015 @08:39PM (#8994837)
You have to store the length, C# strings can contain '\0' (although the hashing code doesn't take this into account!)