Forráskód Böngészése

* Correct comments about sizes/offsets in invisible string header record

git-svn-id: trunk@33247 -
michael 9 éve
szülő
commit
1bdae1edc8
3 módosított fájl, 12 hozzáadás és 13 törlés
  1. 5 5
      rtl/inc/astrings.inc
  2. 5 5
      rtl/inc/ustrings.inc
  3. 2 3
      rtl/inc/wstrings.inc

+ 5 - 5
rtl/inc/astrings.inc

@@ -24,12 +24,12 @@
   This file contains the implementation of the AnsiString type,
   This file contains the implementation of the AnsiString type,
   and all things that are needed for it.
   and all things that are needed for it.
   AnsiString is defined as a 'silent' pchar :
   AnsiString is defined as a 'silent' pchar :
-  a pchar that points to :
+  a pchar that points to (S= SizeOf(SizeInt)):
 
 
-  @-16 : Code page indicator.
-  @-12 : Character size (2 bytes)
-  @-8  : SizeInt for reference count;
-  @-4  : SizeInt for size;
+  @-3*S   : Code page indicator.
+  @-3*S+2 : Character size (2 bytes)
+  @-2*S   : SizeInt for reference count;
+  @-S  : SizeInt for size;
   @    : String + Terminating #0;
   @    : String + Terminating #0;
   Pchar(Ansistring) is a valid typecast.
   Pchar(Ansistring) is a valid typecast.
   So AS[i] is converted to the address @AS+i-1.
   So AS[i] is converted to the address @AS+i-1.

+ 5 - 5
rtl/inc/ustrings.inc

@@ -21,12 +21,12 @@
   This file contains the implementation of the UnicodeString type,
   This file contains the implementation of the UnicodeString type,
   and all things that are needed for it.
   and all things that are needed for it.
   UnicodeString is defined as a 'silent' punicodechar :
   UnicodeString is defined as a 'silent' punicodechar :
-  a punicodechar that points to :
+  a punicodechar that points to (S = SizeOf(SizeInt)) :
 
 
-  @-8  : SizeInt for reference count;
-  @-4  : SizeInt for size; size=number of chars. Multiply with
-         sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
-  @    : String + Terminating #0;
+  @-2*S : SizeInt for reference count;
+  @-S   : SizeInt for size; size=number of chars. Multiply with
+          sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
+  @      : String + Terminating #0;
   Punicodechar(Unicodestring) is a valid typecast.
   Punicodechar(Unicodestring) is a valid typecast.
   So WS[i] is converted to the address @WS+i-1.
   So WS[i] is converted to the address @WS+i-1.
 
 

+ 2 - 3
rtl/inc/wstrings.inc

@@ -18,10 +18,9 @@
   This file contains the implementation of the WideString type,
   This file contains the implementation of the WideString type,
   and all things that are needed for it.
   and all things that are needed for it.
   WideString is defined as a 'silent' pwidechar :
   WideString is defined as a 'silent' pwidechar :
-  a pwidechar that points to :
+  a pwidechar that points to:
 
 
-  @-8  : SizeInt for reference count;
-  @-4  : SizeInt for size; size=number of bytes, not the number of chars. Divide or multiply
+  @-4  : DWord for size; size=number of bytes, not the number of chars. Divide or multiply
          with sizeof(WideChar) to convert. This is needed to be compatible with Delphi and
          with sizeof(WideChar) to convert. This is needed to be compatible with Delphi and
          Windows COM BSTR.
          Windows COM BSTR.
   @    : String + Terminating #0;
   @    : String + Terminating #0;