diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-08-05 00:03:08 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-08-08 07:11:30 +0200 |
commit | d61ea6c5eeef4343e40c0225f22ad39c994f84a9 (patch) | |
tree | 13a5e6261dda3fda33aa7ae743105fc3f2bc2e39 /apps/plugins/lua/lfunc.c | |
parent | 1dabca6c267c2f8dfc8c0fb9269877856c00d4f1 (diff) | |
download | rockbox-d61ea6c5eeef4343e40c0225f22ad39c994f84a9.tar.gz rockbox-d61ea6c5eeef4343e40c0225f22ad39c994f84a9.zip |
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
Diffstat (limited to 'apps/plugins/lua/lfunc.c')
-rw-r--r-- | apps/plugins/lua/lfunc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/plugins/lua/lfunc.c b/apps/plugins/lua/lfunc.c index d2ce63dc4b..ef275cecd2 100644 --- a/apps/plugins/lua/lfunc.c +++ b/apps/plugins/lua/lfunc.c | |||
@@ -128,12 +128,17 @@ Proto *luaF_newproto (lua_State *L) { | |||
128 | f->numparams = 0; | 128 | f->numparams = 0; |
129 | f->is_vararg = 0; | 129 | f->is_vararg = 0; |
130 | f->maxstacksize = 0; | 130 | f->maxstacksize = 0; |
131 | f->lineinfo = NULL; | ||
132 | f->sizelocvars = 0; | 131 | f->sizelocvars = 0; |
133 | f->locvars = NULL; | 132 | f->locvars = NULL; |
134 | f->linedefined = 0; | 133 | f->linedefined = 0; |
135 | f->lastlinedefined = 0; | 134 | f->lastlinedefined = 0; |
136 | f->source = NULL; | 135 | f->source = NULL; |
136 | #ifdef LUA_OPTIMIZE_DEBUG | ||
137 | f->packedlineinfo = NULL; | ||
138 | #else | ||
139 | f->lineinfo = NULL; | ||
140 | |||
141 | #endif | ||
137 | return f; | 142 | return f; |
138 | } | 143 | } |
139 | 144 | ||
@@ -142,7 +147,13 @@ void luaF_freeproto (lua_State *L, Proto *f) { | |||
142 | luaM_freearray(L, f->code, f->sizecode, Instruction); | 147 | luaM_freearray(L, f->code, f->sizecode, Instruction); |
143 | luaM_freearray(L, f->p, f->sizep, Proto *); | 148 | luaM_freearray(L, f->p, f->sizep, Proto *); |
144 | luaM_freearray(L, f->k, f->sizek, TValue); | 149 | luaM_freearray(L, f->k, f->sizek, TValue); |
150 | #ifdef LUA_OPTIMIZE_DEBUG | ||
151 | if (f->packedlineinfo) { | ||
152 | luaM_freearray(L, f->packedlineinfo, f->sizelineinfo, unsigned char); | ||
153 | } | ||
154 | #else | ||
145 | luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); | 155 | luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); |
156 | #endif | ||
146 | luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); | 157 | luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); |
147 | luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); | 158 | luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); |
148 | luaM_free(L, f); | 159 | luaM_free(L, f); |