I have a situation with something like this is going on:

CFHTTPMessageRef response = CFHTTPMessageCreateEmpty(kCFAllocatorMallocZone, FALSE);

CFHTTPMessageAppendBytes(response, bytes, length);
                        
if (CFHTTPMessageIsHeaderComplete(response)) {
        CFIndex statusCode = CFHTTPMessageGetResponseStatusCode(response);
NSDictionary* headerFields = (NSDictionary*)CFHTTPMessageCopyAllHeaderFields(response);
}

Which is taking place in a garbage collected environment. Would the headerFields variable use the same allocator used to create the response (kCFAllocatorMallocZone) or would it be using the default allocator which would mean that it would be in scanned memory?

If headerFields is allocated with kCFAllocatorMallocZone, and I copy like this:

NSDictionary* headerFieldsCopy = [headerFields copy];

Would the copy be allocated with kCFAllocatorMallocZone or the default allocator?

I would like to copy headerFields to scanned memory because it could be passed as the argument to something that assumes it is in scanned memory.

--
Michael
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to