Hello!
I have a (typical beginner's?) question:
I plan to create objects of various kinds within BlitzMax functions, which get called from a Lua script (the Lua environment itself has been setup by BlitzMax and the script has also been called from within BlitzMax). These objects are then passed back to Lua.
Of course, I want the BlitzMax objects to "survive", i.e. not to be garbage collected until they have been (explicitly) released by a BitzMax function (which gets called by Lua, when Lua's GC decides to release the corresponding Lua object)
My question: what is the best way to achieve this behaviour? Should I
- pass VarPtrs to and from Lua? (how gets the Ptr's target object kept in memory then?)
- create "Handles" and pass them to/from Lua? (what type of data are "handles"? do they "refer" to the target in a GC's sense? how do I "release" a handle then?)
- use another approach I do not yet know about?
Thanks in advance for any response!
I have a (typical beginner's?) question:
I plan to create objects of various kinds within BlitzMax functions, which get called from a Lua script (the Lua environment itself has been setup by BlitzMax and the script has also been called from within BlitzMax). These objects are then passed back to Lua.
Of course, I want the BlitzMax objects to "survive", i.e. not to be garbage collected until they have been (explicitly) released by a BitzMax function (which gets called by Lua, when Lua's GC decides to release the corresponding Lua object)
My question: what is the best way to achieve this behaviour? Should I
- pass VarPtrs to and from Lua? (how gets the Ptr's target object kept in memory then?)
- create "Handles" and pass them to/from Lua? (what type of data are "handles"? do they "refer" to the target in a GC's sense? how do I "release" a handle then?)
- use another approach I do not yet know about?
Thanks in advance for any response!