ILP64, LP64, LLP64

One important platform feature, to be considered when writing portable 64-bit code is if it is LP64, LLP64 or ILP64. Those abbreviations stands for size in bits of basic C data types (int, long, void\*, long long):

TypeILP64LP64LLP64
int643232
long646432
pointer646464
long long646464

Win64 is a LLP64 platform, while Solaris and Linux are LP64 platforms. Thus the only safe way to store pointers in integer types is either always use uintptr_t (defined in stdint.h not included at least with MSVC2003 and earlier), or always use long long fields.

Comments:

More:
The forgotten problems of 64-bit programs development.
http://www.viva64.com/articles/Forgotten_problems.html

Posted by Andrew on February 25, 2008 at 01:10 AM MSK #

Post a Comment:
  • HTML Syntax: NOT allowed
About

nike

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today