Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework


Long string dynamic memory layout (Win32 only)



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə247/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   243   244   245   246   247   248   249   250   ...   294
DelphiLanguageGuide

Long string dynamic memory layout (Win32 only)
Offset
Contents
-8
32-bit reference-count
-4
length in bytes
0..Length - 1 character string
Length
NULL character
The NULL character at the end of a long string memory block is automatically maintained by the compiler and the
built-in string handling routines. This makes it possible to typecast a long string directly to a null-terminated string.
For string constants and literals, the compiler generates a memory block with the same layout as a dynamically
allocated string, but with a reference count of -1. When a long string variable is assigned a string constant, the string
pointer is assigned the address of the memory block generated for the string constant. The built-in string handling
routines know not to attempt to modify blocks that have a reference count of -1.
Note:
On the .NET platform, an AnsiString is implemented as an array of unsigned bytes. The information above
on string constants and literals does not apply to the .NET platform.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   243   244   245   246   247   248   249   250   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin