AP_Scripting: added ability to expand heap at runtime if armed

This commit is contained in:
Andrew Tridgell
2024-03-15 13:49:13 +11:00
parent 66752996e4
commit a5ff7f83d1
3 changed files with 4 additions and 1 deletions

View File

@@ -44,7 +44,8 @@ lua_scripts::lua_scripts(const AP_Int32 &vm_steps, const AP_Int32 &heap_size, AP
: _vm_steps(vm_steps),
_debug_options(debug_options)
{
_heap.create(heap_size, 4);
const bool allow_heap_expansion = !option_is_set(AP_Scripting::DebugOption::DISABLE_HEAP_EXPANSION);
_heap.create(heap_size, 10, allow_heap_expansion, 20*1024);
}
lua_scripts::~lua_scripts() {