MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / lua_copy

Function lua_copy

Plugins/slua_unreal/External/lua/lapi.cpp:220–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

pushglobalfuncnameFunction · 0.85

Calls 1

index2addrFunction · 0.85

Tested by

no test coverage detected