FROM : Sean McBride
DATE : Tue Jul 11 23:09:04 2006
On 2006-07-11 13:23, Scott Ellsworth said:
>>> I tried the same thing with an NSString, and with CFZombieLevel
>>> (1, 19, 5, and a few other values based on the tech note), and all
>>> I got were bad access exceptions.
>>>
>>> NSString * string = [[NSString alloc] initWithFormat:@"String %
>>> d", 12];
>>> [string release];
>>> [string length];
>>>
>>> Should I have expected this?
>>
>> Yes. Class cluster objects toll-free bridged to CoreFoundation
>> structures are never zombified; even with NSZombieEnabled set they
>> will always be released.
>
>Huh - I had misunderstood <http://developer.apple.com/technotes/
>tn2004/tn2124.html>, then. It implied to me that CFZombieLevel would
>have caught misbehaviors in CF objects, even if they were toll free
>bridged. Of course, it contains little enough text that I was
>reading a bit more into it than strictly implied.
I have confirmed that CFZombieLevel at least works as expected with
CFStrings. Consider:
CFStringRef str = CFStringCreateWithFormat(0,0,CFSTR("hello"));
CFShow(str);
CFRelease(str);
CFShow(str);
This prints "hello" twice for me, but crashes with CFZombieLevel=65553.
So many types are toll-free bridged, it sucks that neither NS or CF
zombie works with them. :(
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
DATE : Tue Jul 11 23:09:04 2006
On 2006-07-11 13:23, Scott Ellsworth said:
>>> I tried the same thing with an NSString, and with CFZombieLevel
>>> (1, 19, 5, and a few other values based on the tech note), and all
>>> I got were bad access exceptions.
>>>
>>> NSString * string = [[NSString alloc] initWithFormat:@"String %
>>> d", 12];
>>> [string release];
>>> [string length];
>>>
>>> Should I have expected this?
>>
>> Yes. Class cluster objects toll-free bridged to CoreFoundation
>> structures are never zombified; even with NSZombieEnabled set they
>> will always be released.
>
>Huh - I had misunderstood <http://developer.apple.com/technotes/
>tn2004/tn2124.html>, then. It implied to me that CFZombieLevel would
>have caught misbehaviors in CF objects, even if they were toll free
>bridged. Of course, it contains little enough text that I was
>reading a bit more into it than strictly implied.
I have confirmed that CFZombieLevel at least works as expected with
CFStrings. Consider:
CFStringRef str = CFStringCreateWithFormat(0,0,CFSTR("hello"));
CFShow(str);
CFRelease(str);
CFShow(str);
This prints "hello" twice for me, but crashes with CFZombieLevel=65553.
So many types are toll-free bridged, it sucks that neither NS or CF
zombie works with them. :(
--
____________________________________________________________
Sean McBride, B. Eng <email_removed>
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
| Related mails | Author | Date |
|---|---|---|
| Scott Ellsworth | Jul 11, 21:55 | |
| Nick Zitzmann | Jul 11, 22:17 | |
| Scott Ellsworth | Jul 11, 22:23 | |
| Chris Suter | Jul 11, 23:07 | |
| Sean McBride | Jul 11, 23:09 | |
| Sean McBride | Jul 11, 23:15 | |
| Scott Ellsworth | Jul 12, 00:00 |






Cocoa mail archive

