From d61ea6c5eeef4343e40c0225f22ad39c994f84a9 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 5 Aug 2019 00:03:08 -0500 Subject: lua LCD (Lua Compact Debug) patch LCD developed 9/2015 by Terry Ellison We've already discarded the ldebug module from lua it only makes sense to discard the debug info as well adds 1.5 K to the binary saves 8 Kb on the base state once scripts start getting called i've seen 10-50Kb savings but it all depends on what exactly you are running Change-Id: Ibb74f344df1c4c96380ec6c98b010a810e9ae9cc --- apps/plugins/lua/ldump.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/plugins/lua/ldump.c') diff --git a/apps/plugins/lua/ldump.c b/apps/plugins/lua/ldump.c index 9afba60a37..be7dce3497 100644 --- a/apps/plugins/lua/ldump.c +++ b/apps/plugins/lua/ldump.c @@ -113,8 +113,17 @@ static void DumpConstants(const Proto* f, DumpState* D) static void DumpDebug(const Proto* f, DumpState* D) { int i,n; +#ifdef LUA_OPTIMIZE_DEBUG + n = (D->strip || f->packedlineinfo == NULL) ? 0: f->sizelineinfo; + DumpInt(n,D); + if (n) + { + DumpBlock(f->packedlineinfo, n, D); + } +#else n= (D->strip) ? 0 : f->sizelineinfo; DumpVector(f->lineinfo,n,sizeof(int),D); +#endif n= (D->strip) ? 0 : f->sizelocvars; DumpInt(n,D); for (i=0; i