MCPcopy Create free account
hub / github.com/axmolengine/axmol / compat53_countlevels

Function compat53_countlevels

3rdparty/lua/sol/sol.hpp:3827–3844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3825}
3826
3827static int compat53_countlevels(lua_State* L) {
3828 lua_Debug ar;
3829 int li = 1, le = 1;
3830 /* find an upper bound */
3831 while (lua_getstack(L, le, &ar)) {
3832 li = le;
3833 le *= 2;
3834 }
3835 /* do a binary search */
3836 while (li < le) {
3837 int m = (li + le) / 2;
3838 if (lua_getstack(L, m, &ar))
3839 li = m + 1;
3840 else
3841 le = m;
3842 }
3843 return le - 1;
3844}
3845
3846static int compat53_findfield(lua_State* L, int objidx, int level) {
3847 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