Object Pascal Considerations for Multi-Device Applications

From Appmethod Topics
Jump to: navigation, search

Go Up to Multi-Device Applications Index


The Extended Data Type Is 2 Bytes Smaller on 64-bit Windows Systems

The size of the Extended data type is different on Win64 and on Win32:

  • On Win64, the Extended type is an alias for a Double, or 8 bytes.
  • On Win32, the Extended type is (still) 10 bytes.

Thus you have less precision using an Extended data type on Win64 compared to Win32. If your applications use the Extended data type and you rely on precision, such as for floating-point operations, this size difference might affect your data.

Very small or very large values are most affected. The precision of the two data types is as follows:

  • 1x10308 IEEE Double, supported by Win64
  • 1x104932 IEEE Extended, supported by Win32

If your code base contains the Extended data type, you will receive the hint message: W1066 Lost Extended floating point precision. Reduced to Double (Object Pascal). Extended precision floating-point operations are supported in the 32-bit applications and not supported in 64-bit applications. On Win64 the precision of floating-point operations with Extended variables is reduced to double precision.

The TExtended80Rec record can be used to work with extended precision floating-point variables, but only to read or write to and from the memory and to perform low-level changes (modifying the mantissa, exponent, or sign).

For more information about 64-bit data types, see 64-bit Windows Data Types Compared to 32-bit Windows Data Types.

Stack Alignment Issue on OS X

For OS X applications, one big issue is the requirement that all memory data be stack-aligned on 16-byte boundaries:

Migrating Object Pascal Applications from Win32 to OS X

The following table summarizes the platform support by the various libraries in Appmethod:

   Library\Platform         Win32             Win64              Mac OS X    

FMX

Yes

Yes

Yes

RTL

Yes

Yes

Yes

Note: The table above is only a high-level representation of library support for platforms. Some exceptions do exist in RTL support for specific platforms. For example, BDE is not supported on either Win64 or Mac OS X.

Applications that target OS X should be built with FireMonkey (FMX).

The majority of the Object Pascal Run-Time Library (RTL), on the other hand, supports all the Supported Target Platforms. The RTL contains the System, SysUtils, and IOUtils units, and others, which contain platform-neutral elements.

  • Object Pascal applications that use only the RTL work on OS X (and Win32/Win64) with few changes.

For more information about the RTL, see Using the RTL (Run-Time Library).

For more information about FireMonkey, see FireMonkey Application Platform.

Migrating Object Pascal Applications from Win32 to Win64

For Object Pascal Win64 application development, see 64-bit Windows Application Development.

Migrating Object Pascal Applications from Desktop to Mobile

See Migrating Object Pascal Code to Mobile from Desktop.

Inline Assembly Limitations on 64-bit Windows

If your code base contains inline assembly code, you might need to make code changes in order to move to 64-bit. For more information, see the following topics:

See Also