MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_copy

Function lua_copy

third-party/lua-5.3.5/src/lapi.c:222–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221
222LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
223 TValue *fr, *to;
224 lua_lock(L);
225 fr = index2addr(L, fromidx);
226 to = index2addr(L, toidx);
227 api_checkvalidindex(L, to);
228 setobj(L, to, fr);
229 if (isupvalue(toidx)) /* function upvalue? */
230 luaC_barrier(L, clCvalue(L->ci->func), fr);
231 /* LUA_REGISTRYINDEX does not need gc barrier
232 (collector revisits it before finishing collection) */
233 lua_unlock(L);
234}
235
236
237LUA_API void lua_pushvalue (lua_State *L, int idx) {

Callers 1

pushglobalfuncnameFunction · 0.70

Calls 1

index2addrFunction · 0.70

Tested by

no test coverage detected