MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lastlevel

Function lastlevel

extlibs/lua/src/lauxlib.c:116–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116static int lastlevel (lua_State *L) {
117 lua_Debug ar;
118 int li = 1, le = 1;
119 /* find an upper bound */
120 while (lua_getstack(L, le, &ar)) { li = le; le *= 2; }
121 /* do a binary search */
122 while (li < le) {
123 int m = (li + le)/2;
124 if (lua_getstack(L, m, &ar)) li = m + 1;
125 else le = m;
126 }
127 return le - 1;
128}
129
130
131LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1,

Callers 1

luaL_tracebackFunction · 0.85

Calls 1

lua_getstackFunction · 0.85

Tested by

no test coverage detected