GameMonkey Script http://www.gmscript.com/gamemonkey/forum/ |
|
Scripted user objects referenced in native code http://www.gmscript.com/gamemonkey/forum/viewtopic.php?f=6&t=616 |
Page 1 of 1 |
Author: | BinaryDad [ Sat Dec 29, 2012 9:55 pm ] |
Post subject: | Scripted user objects referenced in native code |
Author: | Greg [ Sat Dec 29, 2012 10:53 pm ] |
Post subject: | Re: Scripted user objects referenced in native code |
If your object's destructor (finalizer) code deletes the native object, you really only want one gmObject. So make lots of gmVariables, but only make one gmObject. The common way to do this is create the gmObject for the native instance once, or on demand once, and allow it to be retrieved whenever it's needed. As for GC handling... If script stores an instance of the gmObject, native code need to nothing. However if script does not retain an instance, native code must manage the gmObject to prevent GC from occurring while the object is still alive. In your case, it appears the script type 'sGameObjectSim' is a container and exists in script, so it would likely need a destructor and write barrier. |
Author: | BinaryDad [ Sun Dec 30, 2012 12:31 am ] |
Post subject: | Re: Scripted user objects referenced in native code |
Author: | Greg [ Sun Dec 30, 2012 12:56 am ] |
Post subject: | Re: Scripted user objects referenced in native code |
Author: | BinaryDad [ Sun Dec 30, 2012 1:34 am ] |
Post subject: | Re: Scripted user objects referenced in native code |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |