Re: Question about NSRange on the G5 and the future sizeof(int).
Re: Question about NSRange on the G5 and the future sizeof(int).
- Subject: Re: Question about NSRange on the G5 and the future sizeof(int).
- From: Shawn Erickson <email@hidden>
- Date: Sun, 13 Jul 2003 11:23:26 -0700
On Sunday, July 13, 2003, at 10:13 AM, James Quick wrote:
On Sunday, July 13, 2003, at 12:18 PM, Shawn Erickson wrote:
On Sunday, July 13, 2003, at 07:36 AM, James Quick wrote:
In both Panther and Jaguar, the NSRange structure elements,
'location' and 'length',
are of type unsigned int. I am considering the use of NSRange to
build a
database of locations in a runtime image of an executable. On G3
and G4
architectures this will be correct. What about the G5? Will an
unsigned int
be able to handle sizeof(aPointer)?
It would be risky to stick a memory pointer into the location part
of the range, also that goes against what NSRange is really about.
NRRange is to store an index and length from that index not a pointer
to something in RAM directly. I doubt NSRange will be changed to have
64 bit location (or length) any time soon, unless Apple releases a
complete duplicate 64 bit version of all frameworks.
I would consider making your own structure that used void* or look
around for a CF layer one that may do what you want.
NSRange is the perfect analogue for what I require, so I want to avoid
having to duplicate
all its functionality.
You do realize that NSRange is a very simple structure with a small set
of supporting methods. It is relatively trivial to implement one that
is better suited to your intended goal of storing memory pointers
(which can change in width).
You could get away with using NSRange for now, with the understanding
that you are shoving pointers into a structure that isn't defined to
appropriately track if the size of a pointer changes.
Yes, the near future (Panther) is maintaining 32b effective addresses
(32b wide pointers).
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.