On Fri, Jun 6, 2008 at 11:48 PM, Bill Bumgarner <[EMAIL PROTECTED]> wrote:

> The garbage collector does not currently interpret inner pointers as
> something that can keep an encapsulating object alive.

But it's not the inner pointers I would expect to keep the object
alive -- it's the fact that stack variables are root objects, and that
NSData *data is still in the current stack frame.

>From 
>http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcEssentials.html
:

"The initial root set of objects is comprised of global variables,
stack variables, and objects with external references. These objects
are never considered as garbage. The root set is comprised of all
objects reachable from root objects and all possible references found
by examining the call stacks of every Cocoa thread."

If the optimising compiler is marking variables past a certain point
in the code block as being collectable because it doesn't think
they're going to be used again before the stack frame is popped, this
should be made explicit in the documentation (perhaps it is but I
missed it).

And is it really that important of an optimisation to make, if it's
going to have side effects like this?

Hamish
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to