64 ビット Windows データ型と 32 ビット Windows データ型の比較

提供: RAD Studio
移動先: 案内検索

Windows 向けの 64 ビット クロスプラットフォーム アプリケーション開発 への移動


以下の表は、64 ビット OS のデータ型と 32 ビット OS のデータ型の相違点と類似点をまとめたものです。

Delphi の 32 ビットおよび 64 ビット Windows の組み込み型のサイズ

整数型

Win64 では、NativeInt は Win32 の NativeInt のサイズの 2 倍です。また、NativeUInt も Win32 の NativeUInt のサイズの 2 倍です。

符号付き整数

符号なし整数

Delphi/32

Delphi/64

ShortInt

Byte

1 バイト

SmallInt

Word

2 バイト

LongInt

LongWord

4 バイト

FixedInt

FixedUInt

4 バイト

Integer

Cardinal

4 バイト

Int64

UInt64

8 バイト

NativeInt

NativeUInt

4 バイト

8 バイト

ポインタ型

64 ビット版 Windows では、ポインタ型はすべて 8 バイト(32 ビット版 Windows のサイズの 2 倍)です。

ポインタ型

Delphi/32

Delphi/64

Pointer

4 バイト

8 バイト

string

クラス インスタンス

クラス参照

インターフェイス

AnsiString

WideString

UnicodeString

手続きポインタ

動的配列

PAnsiChar

PWideChar

PChar

オブジェクトの手続き

64 ビット版 Windows では、オブジェクトの手続きのアラインメントは 16 バイト(32 ビット版 Windows の 2 倍)です。

オブジェクトの手続き Delphi/32 Delphi/64 解説
サイズ 8 バイト 16 バイト
アラインメント 8 バイト 16 バイト クロージャ型として知られている

浮動小数点型(Extended 型を含む)

Extended 型は、64 ビット Windows では 32 ビット Windows の場合より、2 バイト分精度が低くなります(前者では 8 バイトであるのに対して、後者では 10 バイト)。

詳細については、「4 ビット Windows システムでは Extended データ型のサイズは 2 バイト小さい」を参照してください。

浮動小数点型

Delphi/32

Delphi/64

解説

Single

4 バイト

Double

8 バイト

Real

8 バイト

Extended

10 バイト

8 バイト

TExtended80Rec は、Win64 では 10 バイトです。

Real48

6 バイト

Comp

8 バイト

Currency

8 バイト

その他の型

Win64 では、ファイル サイズが増えています。

その他の型

Delphi/32

Delphi/64

解説

Boolean

1 バイト

ByteBool

1 バイト

WordBool

2 バイト

LongBool

4 バイト

AnsiChar

1 バイト

WideChar

2 バイト

Char

2 バイト

ShortString

256 バイト

string[N]

N+1 バイト

Variant/OleVariant

16 バイト

24 バイト

file

592 バイト

616 バイト

Text/TextFile

730 バイト

754 バイト

XE リリースでは 720 バイト

定数

定数

Delphi/32

Delphi/64

MaxInt

$7fffffff

MaxLongInt

$7fffffff

C++Builder の 32 ビットおよび 64 ビット Windows の組み込み型のサイズ

以下の表は、C++Builder における 64 ビット OS のデータ型と 32 ビット OS のデータ型の相違点と類似点をまとめたものです。

メモ: System ユニットのメンバ(たとえば System::Byte など)を使用する場合は、#include <System.hpp> の記述が必要です。

整数型

Win64 では、System::NativeInt/ssize_t は、Win32 の System::NativeInt/ssize_t の 2 倍のサイズです。
同様に、System::NativeUInt/ssize_t は、Win32 の System::NativeUInt/size_t の 2 倍のサイズです

符号付き整数

符号なし整数

C++/32

C++/64

解説

signed char

System::Byteunsigned char

1 バイト

System::Smallintshort

System::Wordunsigned short

2 バイト

System::LongIntsigned long

System::LongWord、unsigned

4 バイト

System::Integerint

System::Cardinalunsigned int

4 バイト

System::Int64unsigned __int64long long

System::UInt64unsigned __int64unsigned long long

8 バイト

System::NativeInt, ssize_t

System::NativeUInt, size_t

4 バイト

8 バイト

ポインタ型

64 ビット版 Windows では、ポインタ型はすべて 8 バイト(32 ビット版 Windows のサイズの 2 倍)です。

ポインタ型

C++/32

C++/64

System::Pointer、void*

4 バイト

8 バイト

System::StringSystem::UnicodeString

System::TObject

System::TClass

System::IInterfaceSystem::DelphiInterface

System::AnsiStringSystem::AnsiStringT

System::WideString

System::UnicodeString

System::DynamicArray

System::PAnsiChar

System::PWideChar

System::PChar

__closure

64 ビット Windows では、__closure のアラインメントは 16 バイトで、32 ビット Windows でのサイズの 2 倍になります。

__closure

8 バイト 16 バイト

浮動小数点型(Extended 型を含む)

Extended 型は、64 ビット版 Windows では、2 バイト分精度が低くなります。

詳細については、「4 ビット Windows システムでは Extended データ型のサイズは 2 バイト小さい」を参照してください。

浮動小数点型

C++/32

C++/64

解説

System::Singlefloat(C++)

4 バイト

System::Doubledouble(C++)

8 バイト

System::Extended、long double

10 バイト

8 バイト

TExtended80Rec は、Win64 では 10 バイトです。

Real48

サポートされていません

System::Comp

8 バイト

System::Currency

8 バイト

その他の型

Win64 では、ファイル サイズが増えています。

その他の型

C++/32  

C++/64  

解説  

System::Booleanbool

1 バイト

System::ByteBoolunsigned char

1 バイト

System::WordBoolunsigned short

2 バイト

System::LongBoolunsigned int

4 バイト

System::AnsiCharchar

1 バイト

System::WideCharwchar_t

2 バイト

System::Charwchar_t (Windows)、char16_t (OSX)

2 バイト

System::ShortString

256 バイト

Variant/OleVariant

16 バイト

24 バイト

定数

定数

C++/32  

C++/64  

MaxInt

$7fffffff

MaxLongInt

$7fffffff

関連項目