• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A coding pattern that does not work under Garbage Collection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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:
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>)

  • Prev by Date: Re: A coding pattern that does not work under Garbage Collection
  • Next by Date: ASCII Hexadecimal to ASCII Decimal with NSData
  • Previous by thread: Re: A coding pattern that does not work under Garbage Collection
  • Next by thread: Re: A coding pattern that does not work under Garbage Collection
  • Index(es):
    • Date
    • Thread