Re: NSInteger vs int vs int32_t
Re: NSInteger vs int vs int32_t
- Subject: Re: NSInteger vs int vs int32_t
- From: Scott Ribe <email@hidden>
- Date: Wed, 04 Jul 2012 22:58:37 -0600
On Jul 4, 2012, at 9:36 PM, Nathan Day wrote:
> If you have an array of 32bit ints on a 64bit machine, are the 32bit ints expanded into 64bit ints when copied into the cache...
No, absolutely not. A cache line maps to a contiguous section of RAM of the same size. To do otherwise would add huge complexity--and, actually, would probably be impossible. How is the CPU to know before the memory is used, what is 32-bit values vs what is 64 (16, 8)? What happens when memory is accessed in one line of code as 2 32-bit values, and as 1 64-bit value in the next line.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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