Re: looking for a memory problem
Re: looking for a memory problem
- Subject: Re: looking for a memory problem
- From: Sean McBride <email@hidden>
- Date: Wed, 18 Jul 2012 11:35:40 -0400
- Organization: Rogue Research Inc.
On Wed, 18 Jul 2012 11:03:31 +1000, Shane Stanley said:
>> writing for GC and ARC is not so different, and you can even switch
>over slowly
>
>Could you elaborate on what you mean by "switch over slowly"? I think I
>understand the idea if one is coming from manual reference counting, but
>I thought GC was essentially all or nothing. Or am I reading something
>into your words that you didn't mean?
Shane,
Sure. Well, it's all or nothing from the perspective of compiler flags. When you actually throw the switch from GC to ARC, it's just a one-shot.
But you can prepare your code slowly, in a way that supports both. ex:
- replace all use of NSAllocateCollectable with malloc/free
- change 'retain' to 'strong' in property declarations
- replace CFMakeCollectable with CFBridgingRelease
- replace NSMakeCollectable with a nil check and CFBridgingRelease
That's where I'm at anyway. I'm looking forward to the performance benefits of ARC, but will miss the GC programming model.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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