Re: A coding pattern that does not work under Garbage Collection
Subject : Re: A coding pattern that does not work under Garbage Collection
From: Bill Bumgarner <email@hidden >
Date: Fri, 9 Nov 2007 15:43:56 -0800
Delivered-to: email@hidden
Delivered-to: email@hidden
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
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.