MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / lua_copy

Function lua_copy

lib/lua/src/lapi.c:255–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253
254
255LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) {
256 TValue *fr, *to;
257 lua_lock(L);
258 fr = index2value(L, fromidx);
259 to = index2value(L, toidx);
260 api_check(L, isvalid(L, to), "invalid index");
261 setobj(L, to, fr);
262 if (isupvalue(toidx)) /* function upvalue? */
263 luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr);
264 /* LUA_REGISTRYINDEX does not need gc barrier
265 (collector revisits it before finishing collection) */
266 lua_unlock(L);
267}
268
269
270LUA_API void lua_pushvalue (lua_State *L, int idx) {

Callers 2

pushglobalfuncnameFunction · 0.85
ll_requireFunction · 0.85

Calls 1

index2valueFunction · 0.85

Tested by

no test coverage detected