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 14. Debugging techniques > Detecting zombies

14.4. Detecting zombies

Once an object is deallocated, the Objective-C runtime is free to reuse the associated memory for other memory allocation requests. The object doesn’t exist anymore. It’s “dead” compared to a “live” object that has one or more active owners.

When you attempt to access a dead object, you may get lucky—the object may still be sitting in memory and you won’t notice a difference (when an object is deallocated, the bookkeeping is updated, but what is in memory isn’t overwritten until that memory is reused). But the more likely scenario is that the Objective-C runtime has reassigned the associated memory for another task and attempting to access the dead object will cause an application crash.


  

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