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

Function lua_copy

extlibs/lua/src/lapi.c:228–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226
227
228LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
229 TValue *fr, *to;
230 lua_lock(L);
231 fr = index2value(L, fromidx);
232 to = index2value(L, toidx);
233 api_check(L, isvalid(L, to), "invalid index");
234 setobj(L, to, fr);
235 if (isupvalue(toidx)) /* function upvalue? */
236 luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr);
237 /* LUA_REGISTRYINDEX does not need gc barrier
238 (collector revisits it before finishing collection) */
239 lua_unlock(L);
240}
241
242
243LUA_API void lua_pushvalue (lua_State *L, int idx) {

Callers 3

pushglobalfuncnameFunction · 0.70
luaL_pushresultFunction · 0.70
ll_requireFunction · 0.70

Calls 1

index2valueFunction · 0.85

Tested by

no test coverage detected