On Sep 6, 2009, at 17:36, John Engelhart wrote:

So, since the Mac OS X documentation uses the term "interior pointer" in a totally non-standard way, and I can't find anything wrt/ to what I'm looking for, my question is:

Does the Mac OS X garbage collector support interior pointers (as defined at http://www.memorymanagement.org/glossary/i.html#interior.pointer )?

Huh?

You know it doesn't. You've beaten up on GC before, with reference to *both* senses of "interior pointer".

I certainly hope this isn't the case because this essentially means that it is fundamentally impossible to write programs that execute in a deterministic fashion when using GC. It is basically impossible to write code that guarantees that the base pointer remains visible to the collector, particularly when __weak and/or the optimizer is used. Things work the vast majority of the time because there is (usually) a very small window of time where it could actually cause a problem and one of two things are true: 1) When the compiler generates code that, as a side effect, only uses interior pointers (this happens much, much more frequently than you would think), there's "something" that covers this fundamental error with a base pointer. This is invariably due to a happy set of coincidences and rarely the explicit, intentional result of the programmer. 2) The collector is not collecting during the window of vulnerability.

You also know that no one else on this list agrees with you on this subject, so I don't understand why you're asking about it.

*Of course* every programmer explicitly and intentionally ensures that the lifetimes of "base" pointers continue for as long as "derived" or "interior" pointers need to be valid. That's the Mac OS X garbage collection architecture, for now.

Of course it's possible to forget to maintain the base pointer (or fail to realize that it's necessary). Of course there are a few cases where it's much easer to forget than is reasonable. Of course forgetting to do it opens up a window of vulnerability. Of course that sucks.

But it's no more broken now than the last time the list discussed this. There's nothing new here. Time to move on.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to