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

Function addk

third-party/lua-5.5.0/src/lcode.c:545–556  ·  view source on GitHub ↗

** Add constant 'v' to prototype's list of constants (field 'k'). */

Source from the content-addressed store, hash-verified

543** Add constant 'v' to prototype's list of constants (field 'k').
544*/
545static int addk (FuncState *fs, Proto *f, TValue *v) {
546 lua_State *L = fs->ls->L;
547 int oldsize = f->sizek;
548 int k = fs->nk;
549 luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants");
550 while (oldsize < f->sizek)
551 setnilvalue(&f->k[oldsize++]);
552 setobj(L, &f->k[k], v);
553 fs->nk++;
554 luaC_barrier(L, f, v);
555 return k;
556}
557
558
559/*

Callers 2

k2protoFunction · 0.70
luaK_numberKFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected