• 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
Re: GC memory leak - what is it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC memory leak - what is it?


  • Subject: Re: GC memory leak - what is it?
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 04 Jan 2010 15:30:27 -0800

On Jan 4, 2010, at 2:27 PM, Oftenwrong Soong wrote:

> According to the docs, the collector "scans" all of your objects to determine what needs to be deallocated. But in performing this scan, how does it "know" which bits in your object are pointers to other objects and which bits are just data?

The Objective-C compiler has always generated extended type information for classes, so you can not only tell what the offset of an instance variable is at runtime, but also what its type is.

When building GC-supported or GC-required, the compiler additionally provides a layout bitmap that gives the collector a faster way to know what offsets should be considered to hold strong and weak references.  See class_setIvarLayout and class_setWeakIvarLayout in the Objective-C Runtime Reference; anyone constructing classes “by hand” (e.g. using objc_allocateClassPair) needs to use these if they want their classes to work under GC.

  — Chris

_______________________________________________

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

References: 
 >GC memory leak - what is it? (From: "email@hidden" <email@hidden>)
 >Re: GC memory leak - what is it? (From: Bill Bumgarner <email@hidden>)
 >Re: GC memory leak - what is it? (From: Oftenwrong Soong <email@hidden>)

  • Prev by Date: Re: Turn off font hinting?
  • Next by Date: Re: Turn off font hinting?
  • Previous by thread: Re: GC memory leak - what is it?
  • Next by thread: Re: GC memory leak - what is it?
  • Index(es):
    • Date
    • Thread