Re: Is the "id" type an immovable pointer? Or a movable handle
Re: Is the "id" type an immovable pointer? Or a movable handle
- Subject: Re: Is the "id" type an immovable pointer? Or a movable handle
- From: John Stiles <email@hidden>
- Date: Fri, 2 Feb 2007 10:51:46 -0800
On Feb 2, 2007, at 10:43 AM, Matt Neuburg wrote:
On Wed, 31 Jan 2007 18:06:56 -0500, Ken Tozier
<email@hidden> said:
if objects don't move around in memory after allocation, I
could just package the id to an NSNumber and use that for the key.
Anyone know if ids are pointers or handles?
The pre-X distinction between pointers and handles is obviated by
Mac OS X
memory management. Under Mac OS X, objects move around in memory
all the
time (unless they are explicitly wired down). But your code doesn't
know
about this, because there is a virtual memory map between your code
and the
actual storage. In other words, under Mac OS X, *all* pointers are
actually
handles. Sort of. Anyway, this clearly isn't what you wanted to
know. :) m.
To be more pedantic/literal about it, it's any 4K memory pages that
can move around in memory, not pointers per se.
In other words, the granularity isn't based on pointers but rather
memory pages.
(I know you know this but the OP may not ... )
At any rate this is clearly unrelated to anything the OP is asking
about ;) It all happens in mysterious, murky places inside the
kernel. To our code, memory is a simple flat plane, never reshuffled
or swapped out.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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