With ARC enabled(XCode 4.3.2, iOS 4.0), _CFAutoreleasePoolPrintPools() does not print the address of token in any pools. I checked that token is released as expected after the pool ends, so there is no issue but something goes behind scenes. I suspect that it may be something related to objc_autoreleaseReturnValue.
@autoreleasepool {
NSMutableString *token = [NSMutableString string];
// When following line uncommented,
// **token** is listed in autorelease pool by _CFAutoreleasePoolPrintPools.
//[token appendFormat:@"%@", @"xyz"];
NSLog(@"%@", token);
}
So, is not _CFAutoreleasePoolPrintPools() reliable? How could token be autoreleased although not listed in any autorelease pool?
Edit: As i finally find out the reason and determined that it's already been listed, the appendFormat must not work different. It seems that while calling appendFormat, memory addresses were in the ([1..F]XXX XXXX) range so _CFAutoreleasePoolPrintPools lists those addresses exactly and i could find the address when i searched.
I have been bitten by left-most excessive zeroes in memory address. I was directly copying and searching the address returned for the token. NSMutableString instance actually appears as __NSCFString in the list returned by _CFAutoreleasePoolPrintPools().