From: Arno P. <ar...@pu...> - 2013-02-22 06:30:10
|
this is an extremely tricky subject. Yes, you have to be very careful when mixing the two memory management models. I can only barely scratch the surface but, in essence, the cross-compiled Java version of NSObject becomes a wrapper around the native instance to an NSObject. When the GC reclaims the cross-compiled NSObject, it will call a finalizer (essentially overriding Object.finalize()) that will delegate the release to the wrapped Objective-C instance. But as I said, it gets a lot more complicated: associations between objects (e.g. UIView.subviews) and delegates need special attention. Arno On 2/21/13 7:49 PM, Steve Hannah wrote: > I'm experimenting using XMLVM to compile business logic, which I then > use inside a Cocoa GUI app - built with Xcode. I am trying to get an > understanding of the implications of XMLVM's garbage collected > pointers used together with objective-c objects. > > This page <http://www.hpl.hp.com/personal/Hans_Boehm/gc/simple_example.html> > says: > "It is usually best not to mix garbage-collected allocation with the > system malloc-free. If you do, you need to be careful not to store > pointers to the garbage-collected heap in memory allocated with the > system malloc." > > Does this mean that I shouldn't be storing JAVA_OBJECTs as properties > of objective-c classes? Are there any best practices that should be > followed here? > > Thanks for any tips. > > -Steve > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users > |