MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / lua_settable

Function lua_settable

3rd/lua-5.4.3/src/lapi.c:849–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847
848
849LUA_API void lua_settable (lua_State *L, int idx) {
850 TValue *t;
851 const TValue *slot;
852 lua_lock(L);
853 api_checknelems(L, 2);
854 t = index2value(L, idx);
855 if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) {
856 luaV_finishfastset(L, t, slot, s2v(L->top - 1));
857 }
858 else
859 luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot);
860 L->top -= 2; /* pop index and value */
861 lua_unlock(L);
862}
863
864
865LUA_API void lua_setfield (lua_State *L, int idx, const char *k) {

Callers

nothing calls this directly

Calls 2

index2valueFunction · 0.85
luaV_finishsetFunction · 0.85

Tested by

no test coverage detected