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


Wide string dynamic memory layout (Win32 only)



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

Wide string dynamic memory layout (Win32 only)
Offset
Contents
-4
32-bit length indicator (in bytes)
0..Length -1 character string
Length
NULL character
The string length is the number of bytes, so it is twice the number of wide characters contained in the string.
The NULL character at the end of a wide string memory block is automatically maintained by the compiler and the
built-in string handling routines. This makes it possible to typecast a wide string directly to a null-terminated string.
On the .NET platform, String and WideString types are implemented using the System.String type. An empty string
is not a nil pointer, and the string data is not terminated with a null character.
Set Types
A set is a bit array where each bit indicates whether an element is in the set or not. The maximum number of elements
in a set is 256, so a set never occupies more than 32 bytes. The number of bytes occupied by a particular set is
equal to
(Max div 8) (Min div 8) + 1
where Max and Min are the upper and lower bounds of the base type of the set. The byte number of a specific
element E is
(E div 8) (Min div 8)
and the bit number within that byte is
210


E mod 8
where E denotes the ordinal value of the element. When possible, the compiler stores sets in CPU registers, but a
set always resides in memory if it is larger than the generic Integer type or if the program contains code that takes
the address of the set.
Note:
On the .NET platform, sets containing more than 32 elements are implemented as an array of bytes. The set
type in Delphi for .NET is not CLS compliant, therefore other .NET languages cannot use them.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   245   246   247   248   249   250   251   252   ...   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