Sander van Rossen wrote:
> [...]
>   
>>    * Two lengths are stored, one with the null terminator (no longer
>>      needed) and one that is the actual length.
>>          o Obviously drop the first.
>>     
>
> I think "m_arrayLength" is the capacity of the string.. you basically
> allocate a little more memory than you need, this saves you from
> allocating new memory every time you add a single character..
>   
Remember, strings in .Net are immutable. That is: "a" + "b" results in 3 
strings in memory: "a", "b" and "ab". The functionality you are talking 
about belongs in the StringBuilder class. m_arrayLength = m_stringLength 
+ 1, where the 1 is for the '\0' character at the end.
>>          o The second is an Signed Int32. Why did they use signed ints?
>>            Can anyone come up with a good argument for this? Maybe we
>>            should use a UInt32 instead.
>>     
>
> I can't imagine why you would need the sign bit...
>   
Me Too!!! Probably Win32 interop once again.

-- 
                              Jonathan Dickinson


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SharpOS-Developers mailing list
SharpOS-Developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sharpos-developers

Reply via email to