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

Function lua_resetthread

extlibs/lua/src/lstate.c:354–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352
353
354int lua_resetthread (lua_State *L) {
355 CallInfo *ci;
356 int status;
357 lua_lock(L);
358 ci = &L->base_ci;
359 status = luaF_close(L, L->stack, CLOSEPROTECT);
360 setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */
361 if (status != CLOSEPROTECT) /* real errors? */
362 luaD_seterrorobj(L, status, L->stack + 1);
363 else {
364 status = LUA_OK;
365 L->top = L->stack + 1;
366 }
367 ci->callstatus = CIST_C;
368 ci->func = L->stack;
369 ci->top = L->top + LUA_MINSTACK;
370 L->ci = ci;
371 L->status = status;
372 lua_unlock(L);
373 return status;
374}
375
376
377LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {

Callers 2

luaB_auxwrapFunction · 0.85
luaB_closeFunction · 0.85

Calls 2

luaF_closeFunction · 0.85
luaD_seterrorobjFunction · 0.85

Tested by

no test coverage detected