Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64 bit addressing



On Saturday, June 28, 2003, at 03:10 PM, Chris Kane wrote:

On Saturday, June 28, 2003, at 11:08, Mike Vannorsdel wrote:

Then it sounds like most of Mac OS X will remain 32-bit except for special cases (apps which need the large allocations). It seems like making the libraries 64-bit will cause huge backwards compatibility problems. Unless there are 32 and 64-bit versions of each.

I assume there will need to be an entire stack of libraries for 32 and another for 64 bit, with no mix-n-matching.

What would happen if your 32-bit code linked with a 64-bit lib?

I assume that the upper 32 bits in the general purpose registers in a 32-bit task would always be zeros, since the task wouldn't be putting anything in there itself. However, if the library tried to return something > 32 bits, the 32 bit task won't see the value properly in some way or other. Or, if a pointer to a pointer was being passed in, the 64-bit library might put a 64-bit pointer in the space for a 32-bit pointer that the app is passing a reference to. It's all just trouble waiting to happen.

i had the opportunity to talk about this issue with jim magee at the campus beer bash :-) so i've been thinking about this for a couple days. having an entire stack of libraries for both 32 and 64 bit code seems ineffiecient. a good solution might be:

a) provide new 64 bit allocators vm_allocate64(), malloc64()...etc, this way any buffers created by the old allocators can be guaranteed to be in the 32 bit space; and would fail if 32 bit space was full.

b) provide one set of 64bit clean system libraries across the board for jaguar64; however, the libraries only use the 32 bit allocators internally. this way 32 bit pointers going into a library will obviously work, libraries will only create, copy and return to 32 bit space, and a 64 bit pointer passed into a library will either round trip cleanly, or get copied and returned into 32 bit space for any api that copies the data.

the only corner cases might be api that explic
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: 64 bit addressing (From: Chris Kane <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.