【收藏帖】windows和Linux的数据类型对比
2015-12-04 10:36
441 查看
目前的疑问:
64位的Linux的long是64bit
64位的windows的long仍旧是32bit,why?
Platform SDK: 64-bit Windows Programming
Abstract Data Models
Every application and every operating system has an abstract data model. Many applications do not explicitly expose this data model, but the model guides the
way in which the application's code is written. In the 32-bit programming model (known as the ILP32 model), integer, long, and pointer data types are 32 bits in length. Most developers have used this model without realizing it. For the history of the Win32?
API, this has been a valid (although not necessarily safe) assumption to make.
In 64-bit Microsoft? Windows?, this assumption of parity in data type sizes is invalid.
Making all data types 64 bits in length would waste space, because most applications do not need the increased size.
However, applications do need pointers to 64-bit data, and they need the ability to have 64-bit data types in selected cases. These
considerations led to the selection of an abstract data model called LLP64 (or P64). In the LLP64 data model, only pointers expand to 64 bits; all other basic data types (integer and long) remain 32 bits in length.
Initially, most applications that run on 64-bit Windows will have been ported from 32-bit Windows. It is a goal that the same source, carefully written, should
run on both 32- and 64-bit Windows. Defining the data model does not make this task easier. However, ensuring that the data model affects only pointer data types is the first step. The second step is to define a set of new data types that allow developers
to automatically size their pointer-related data. This allows data associated with pointers to change size as the pointer size changes from 32 bits to 64 bits. Basic data types remain 32 bits in length, so there is no change in the size of data on the disk,
data shared over a network, or data shared through memory-mapped files. This relieves developers of much of the effort involved in porting 32-bit code to 64-bit Windows.
These new data types have been added to the Windows API header files. Therefore, you can start using the new types now. For more information, see The New Data
Types.
64位的Linux的long是64bit
64位的windows的long仍旧是32bit,why?
Platform SDK: 64-bit Windows Programming
Abstract Data Models
Every application and every operating system has an abstract data model. Many applications do not explicitly expose this data model, but the model guides the
way in which the application's code is written. In the 32-bit programming model (known as the ILP32 model), integer, long, and pointer data types are 32 bits in length. Most developers have used this model without realizing it. For the history of the Win32?
API, this has been a valid (although not necessarily safe) assumption to make.
In 64-bit Microsoft? Windows?, this assumption of parity in data type sizes is invalid.
Making all data types 64 bits in length would waste space, because most applications do not need the increased size.
However, applications do need pointers to 64-bit data, and they need the ability to have 64-bit data types in selected cases. These
considerations led to the selection of an abstract data model called LLP64 (or P64). In the LLP64 data model, only pointers expand to 64 bits; all other basic data types (integer and long) remain 32 bits in length.
Initially, most applications that run on 64-bit Windows will have been ported from 32-bit Windows. It is a goal that the same source, carefully written, should
run on both 32- and 64-bit Windows. Defining the data model does not make this task easier. However, ensuring that the data model affects only pointer data types is the first step. The second step is to define a set of new data types that allow developers
to automatically size their pointer-related data. This allows data associated with pointers to change size as the pointer size changes from 32 bits to 64 bits. Basic data types remain 32 bits in length, so there is no change in the size of data on the disk,
data shared over a network, or data shared through memory-mapped files. This relieves developers of much of the effort involved in porting 32-bit code to 64-bit Windows.
These new data types have been added to the Windows API header files. Therefore, you can start using the new types now. For more information, see The New Data
Types.
相关文章推荐
- linux下搭建生成HLS所需的.ts和.m3u8文件
- linux下面安装软件学习流程
- 交叉编译器简介以及ARM交叉编译器arm-linux-gcc
- 红帽老版本下载地址
- Linux中fork函数详解
- linux挂在文件到系统文件中
- Linux-top命令详解
- Dell PowerEdge R710服务器Centos6.2在线扩容raid
- 虚拟机上centos7静态IP的配置
- linux awk命令详解(二) awk选项含义
- linux awk命令详解(一) awk语法 awk运算 awk数组
- linux sudo权限
- centos6.5 修改ssh默认端口号 禁用root登录
- linux java 安装路径
- Linux 查看磁盘空间
- linux下调整音量大小
- 项目管理中用到的Linux开源应用
- 关于cmder--windows下使用linux命令
- 串口驱动移植心得
- linux常用基本命令之十七 rpm