copy object in kCFAllocatorMallocZone to scanned zone?
copy object in kCFAllocatorMallocZone to scanned zone?
- Subject: copy object in kCFAllocatorMallocZone to scanned zone?
- From: Michael Link <email@hidden>
- Date: Tue, 23 Dec 2008 13:19:23 -0600
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 (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