> String Type:
>
>    * Has null terminator, for interopability with older Win32 code. We
>      couldn't give a hoot about interop with Win32 code :).

might be usefull for debugging though...


>    * Each char, is indeed, a fixed length UTF-16 (Unicode) bit sequence
>      (2 bytes in length).
>          o We should decide: UTF-16 or UTF-32 as a standard? Point for
>            a meeting? UTF-16 has a smaller footprint, UTF-32 hits a
>            much larger market.

UTF-16 would make it easier to serialize data which has been saved by
other non sharp OS applications...


>    * Has a m_firstChar field. In the article this is a char, but I
>      assume that it is a char*.

well maybe it's actually closer to
struct
{
bool interned; // set when string is interned / pooled
int capacity;
int length;
fixed char[] characters;
}
this would only require one memory block for your string instead of two..
ofcourse with a char* it's easier to implement null strings...


>    * 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..


>          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...

-------------------------------------------------------------------------
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