AP_Scripting: add debug print of state memory cost
This commit is contained in:
parent
815adbbc8e
commit
7e07859ec9
@ -462,9 +462,19 @@ void lua_scripts::run(void) {
|
|||||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Couldn't allocate a lua state");
|
gcs().send_text(MAV_SEVERITY_CRITICAL, "Lua: Couldn't allocate a lua state");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAL_CONSOLE_DISABLED
|
||||||
|
const int inital_mem = lua_gc(L, LUA_GCCOUNT, 0) * 1024 + lua_gc(L, LUA_GCCOUNTB, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
lua_atpanic(L, atpanic);
|
lua_atpanic(L, atpanic);
|
||||||
load_generated_bindings(L);
|
load_generated_bindings(L);
|
||||||
|
|
||||||
|
#ifndef HAL_CONSOLE_DISABLED
|
||||||
|
const int loaded_mem = lua_gc(L, LUA_GCCOUNT, 0) * 1024 + lua_gc(L, LUA_GCCOUNTB, 0);
|
||||||
|
DEV_PRINTF("Lua: State memory usage: %i + %i\n", inital_mem, loaded_mem - inital_mem);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Scan the filesystem in an appropriate manner and autostart scripts
|
// Scan the filesystem in an appropriate manner and autostart scripts
|
||||||
// Skip those directores disabled with SCR_DIR_DISABLE param
|
// Skip those directores disabled with SCR_DIR_DISABLE param
|
||||||
uint16_t dir_disable = AP_Scripting::get_singleton()->get_disabled_dir();
|
uint16_t dir_disable = AP_Scripting::get_singleton()->get_disabled_dir();
|
||||||
|
Loading…
Reference in New Issue
Block a user