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

Function compat53_countlevels

extlibs/sol3/include/sol/sol.hpp:2687–2699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2685}
2686
2687static int compat53_countlevels(lua_State *L) {
2688 lua_Debug ar;
2689 int li = 1, le = 1;
2690 /* find an upper bound */
2691 while (lua_getstack(L, le, &ar)) { li = le; le *= 2; }
2692 /* do a binary search */
2693 while (li < le) {
2694 int m = (li + le) / 2;
2695 if (lua_getstack(L, m, &ar)) li = m + 1;
2696 else le = m;
2697 }
2698 return le - 1;
2699}
2700
2701static int compat53_findfield(lua_State *L, int objidx, int level) {
2702 if (level == 0 || !lua_istable(L, -1))

Callers 1

luaL_tracebackFunction · 0.85

Calls 1

lua_getstackFunction · 0.85

Tested by

no test coverage detected