Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?
Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?
- Subject: Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?
- From: "Clark Cox" <email@hidden>
- Date: Thu, 11 Dec 2008 15:29:08 -0800
On Thu, Dec 11, 2008 at 1:50 PM, Jesper Storm Bache <email@hidden> wrote:
>> Yes. Even if you're not going to go 64-bit now, I would strongly
>> recommend you at least get your code ready for it, because there will
>> be a day when the i386 architecture gets deprecated. That means
>> switching ints to NSIntegers, getting rid of FSSpec, etc.
>
> Minor point to be aware of when you go to 64 bit.
> Apple uses LP64 - meaning that long and pointers are 64 bit, but int's are
> 32 bit (see http://en.wikipedia.org/wiki/LP64).
>
> A potential source of confusing is that NSInteger in 64 bit is not an int,
> but a long. This means that NSInteger is 64 bit on 64 bit systems.
> A general switch from int to NSInteger is therefore probably not
> appropriate,
For function/method parameters and return types, an unconditional
switch to NSInteger/NSUInteger is fine (the registers are all 64-bit,
so you lose nothing by doing so; a 32-bit type would still take up the
entire 64-bit register)
> but a switch to NSInteger is needed when you want to store the
> result of any API that returns an NSInteger.
Indeed. For structures and arrays especially, you should consider
carefully whether or not you *need* a 64-bit type, as the doubling in
size can become significant there.
--
Clark S. Cox III
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden