Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Garbage Collection > Core Foundation Objects and Garbage Collection

Core Foundation Objects and Garbage Collection

Core Foundation objects can be allocated from either the auto zone (garbage collected) or from the malloc zone (non-garbage collected). You specify which zone to use for the object by the value of the allocator argument of the CFxxxCreate routine used to create the object. If you specify NULL, kCFAllocatorDefault, or kCFAllocatorSystemDefault, the object comes from the auto zone. If you specify kCFAllocatorMallocZone or kCFAllocatorMalloc, the object comes from the malloc zone.

Core Foundation objects allocated from the malloc zone behave the same way as they do under reference counting. They are returned from the create routines with a reference count of one. When their reference count drops to zero, they are immediately deallocated.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint