1
0
Fork 0
forked from len0rd/rockbox

lua latebound function update

return the nextfunction and nil instead of pairs it allows a faster
return to lua rather than calling the lua function
pcall(fnpairs) from c and returning the result back
into lua to kick off the search
yeah, no clue why I didn't realize that before..

testing in x86 and ARM..
its more RAM efficient to do the initial creation
of the stack in lua code for the __pairs functon
its not faster but being that its a one time hit per
iter creation the reduced churn alone should be worth it
along with a reduced peak RAM usage

fix bug where a failed module can not be reloaded

optimize filetol

fix potential bug in splash scroller when no break character is found
Change-Id: I42c922e07039a19138b97c0d0e80cf3cf2426471
This commit is contained in:
William Wilgus 2021-05-11 21:35:41 -04:00 committed by William Wilgus
parent 0c62177575
commit dcff9b85a3
4 changed files with 51 additions and 29 deletions

View file

@ -130,9 +130,11 @@ static int ll_require (lua_State *L) {
lua_pushliteral(L, ""); /* error message accumulator */
for (i=1; ; i++) {
lua_rawgeti(L, -2, i); /* get a loader */
if (lua_isnil(L, -1))
if (lua_isnil(L, -1)) {
lua_setfield(L, 2, name); /* _LOADED[name] = nil */
luaL_error(L, "module " LUA_QS " not found:%s",
name, lua_tostring(L, -2));
}
lua_pushstring(L, name);
lua_call(L, 1, 1); /* call it */
if (lua_isfunction(L, -1)) /* did it find module? */