• 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: can you autorelease toll-free bridged types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can you autorelease toll-free bridged types


  • Subject: Re: can you autorelease toll-free bridged types
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 31 Aug 2010 09:54:10 -0700

On Tue, Aug 31, 2010 at 9:45 AM, David Duncan <email@hidden> wrote:
>
> On Aug 31, 2010, at 9:34 AM, Roland King wrote:
>
>> Of course I now have to ask if I *were* doing it .. what's the issue?
>
> Under GC -retain, -release, -autorelease and -retainCount are no-ops (objc_msgSend doesn't even dispatch them).
>
>> Is it that autorelease doesn't do anything so the CF type never gets the CFRelease() call it would do from a real -release? What does CFMakeCollectable() do if you are memory managed .. nothing? These are things I've not had to worry about but you piqued my interest.
>
>
> CFMakeCollectable() does nothing under Retain/Release and calls CFRelease() under GC. The typical idiom for dual mode code is to do "[NSMakeCollectable(foo) autorelease]" which will ensure the object will be released under both RR and GC (NSMakeCollectable is identical to CFMakeCollectable except for its return value being id instead of void*).

To backup what David states review...

<http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcCoreFoundation.html>
_______________________________________________

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: 
 >can you autorelease toll-free bridged types (From: Roland King <email@hidden>)
 >Re: can you autorelease toll-free bridged types (From: Mike Abdullah <email@hidden>)
 >Re: can you autorelease toll-free bridged types (From: Dave DeLong <email@hidden>)
 >Re: can you autorelease toll-free bridged types (From: Roland King <email@hidden>)
 >Re: can you autorelease toll-free bridged types (From: David Duncan <email@hidden>)

  • Prev by Date: Re: can you autorelease toll-free bridged types
  • Next by Date: Re: zlib works in Dubug, not in Release
  • Previous by thread: Re: can you autorelease toll-free bridged types
  • Next by thread: where are the CALayer struts and springs on iPhone?
  • Index(es):
    • Date
    • Thread