ardupilot/libraries/AP_Scripting/generator
Thomas Watson b64ed6ca56 AP_Scripting: dynamically load some binding objects
Only create the binding object (singleton metatable/userdata or C
function reference) once the user first references a particular
singleton or userdata creation function. Once created, the object is
stored into the script's environment so it doesn't get recreated on the
next reference and there isn't any further overhead. The userdatas are
no longer shared between scripts which imposes a slight memory penalty
for multiple scripts using the same singleton but this avoids an
additional lookup time cost.

Userdata and ap_objects aren't eligible for this optimization as the C++
code might want a particular metatable at any time.

Saves ~9.3K Lua heap.
2024-07-23 10:34:52 +10:00
..
description AP_Scripting: add battery resistance to bindings 2024-07-22 09:09:26 +10:00
src AP_Scripting: dynamically load some binding objects 2024-07-23 10:34:52 +10:00