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: A coding pattern that does not work under Garbage Collection



On Nov 9, 2007, at 11:35 AM, Rick Hoge wrote:
Regarding NSAllocateCollectible, just to make sure I am not misunderstanding - I can allocate memory like the example below?

__strong int* tempInt = (__strong int*)NSAllocateCollectable(sizeof(int), NSScannedOption);

and rely on the garbage collector to figure out when I've reached a point where tempInt could no longer possibly be used to access that memory? so no leaks even without a free()?

Thanks for this and the other very informative replies to this post.

That is correct.

b.bum
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden
References: 
 >A coding pattern that does not work under Garbage Collection (From: Rick Hoge <email@hidden>)
 >Re: A coding pattern that does not work under Garbage Collection (From: Jim Correia <email@hidden>)
 >Re: A coding pattern that does not work under Garbage Collection (From: Rick Hoge <email@hidden>)
 >Re: A coding pattern that does not work under Garbage Collection (From: Jim Correia <email@hidden>)
 >Re: A coding pattern that does not work under Garbage Collection (From: Bill Bumgarner <email@hidden>)
 >Re: A coding pattern that does not work under Garbage Collection (From: Rick Hoge <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.