• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
copy object in kCFAllocatorMallocZone to scanned zone?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: copy object in kCFAllocatorMallocZone to scanned zone?
      • From: Michael Link <email@hidden>
  • Prev by Date: Re: Finding front most window of a document
  • Next by Date: Re: copy object in kCFAllocatorMallocZone to scanned zone?
  • Previous by thread: Re: Finding front most window of a document
  • Next by thread: Re: copy object in kCFAllocatorMallocZone to scanned zone?
  • Index(es):
    • Date
    • Thread