Re: NSInteger vs int vs int32_t
Re: NSInteger vs int vs int32_t
- Subject: Re: NSInteger vs int vs int32_t
- From: Greg Parker <email@hidden>
- Date: Mon, 09 Jul 2012 11:40:39 -0700
On Jul 9, 2012, at 5:44 AM, Vincent Habchi <email@hidden> wrote:
> Modern CPU do not enforce strict alignment for integer access. You can perfectly access a Dword (64 bits) at any address, even or odd. It is just more efficient to align 64-bits words at 8-bytes boundary, 32-bits at 4-bytes, etc. This contrasts with the old times: for example, on a 68000 processor, trying to access a 16-bit word at an odd address (e.g. move.w d0, (a0)+ with a0 odd) would result in a exception n°3 (address error).
Some CPUs still enforce aligned integer access, such as the ARM CPUs in some iOS devices. If your iOS crash log says EXC_ARM_DA_ALIGN then you died from a misalignment fault.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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