MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_copy

Function lua_copy

depends/lua/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 3

dfhack_curry_wrapFunction · 0.85
do_notifyMethod · 0.85
pushglobalfuncnameFunction · 0.85

Calls 1

index2addrFunction · 0.85

Tested by

no test coverage detected