MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lastlevel

Function lastlevel

lib/lua/src/lauxlib.c:117–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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