• 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: Cocoa Classes from C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Classes from C++?


  • Subject: Re: Cocoa Classes from C++?
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 27 May 2008 22:14:01 -0700

On May 27, 2008, at 9:09 PM, Jens Alfke wrote:
On 27 May '08, at 8:59 PM, Bill Bumgarner wrote:
In this case, it will change the way that GC handles the pointer, depending on how the class is compiled. GC is aware of the layout of objects and will scan only the fields that are marked __strong or are of an Objective-C object reference type.
But the pointer that's being lied about here is to a C++ object, which the collector should be ignoring anyway, right?

Unless you were to compile the class such that the objective-c world sees it as an Objective-C object pointer... Then it would be scanned as if it were rooted in the GC world and, potentially, bad things could happen.


BTW: This is similar to the current crash in 10.5.2 with the Media Browser in the Open Panel. The class layout bitmap is incorrect, denoting that a particular ivar is a void* instead of id, and -- thus -- the collector doesn't see a reference that should be keeping an object alive and said object is collected out from under subsystems that expect it to stick around.

b.bum

_______________________________________________

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: Cocoa Classes from C++?
      • From: Fritz Anderson <email@hidden>
References: 
 >Cocoa Classes from C++? (From: "J. Todd Slack" <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Andrew Farmer <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Jens Alfke <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Todd Heberlein <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Jens Alfke <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Bill Bumgarner <email@hidden>)
 >Re: Cocoa Classes from C++? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Alert Sheets hard wired in Interface Builder
  • Next by Date: Re: NSNotificationCenter: addObserver:selector:name:object: - Specifying a single event
  • Previous by thread: Re: Cocoa Classes from C++?
  • Next by thread: Re: Cocoa Classes from C++?
  • Index(es):
    • Date
    • Thread