MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaK_settablesize

Function luaK_settablesize

extlibs/lua/src/lcode.c:1732–1740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1730
1731
1732void luaK_settablesize (FuncState *fs, int pc, int ra, int asize, int hsize) {
1733 Instruction *inst = &fs->f->code[pc];
1734 int rb = (hsize != 0) ? luaO_ceillog2(hsize) + 1 : 0; /* hash size */
1735 int extra = asize / (MAXARG_C + 1); /* higher bits of array size */
1736 int rc = asize % (MAXARG_C + 1); /* lower bits of array size */
1737 int k = (extra > 0); /* true iff needs extra argument */
1738 *inst = CREATE_ABCk(OP_NEWTABLE, ra, rb, rc, k);
1739 *(inst + 1) = CREATE_Ax(OP_EXTRAARG, extra);
1740}
1741
1742
1743/*

Callers 1

constructorFunction · 0.85

Calls 1

luaO_ceillog2Function · 0.85

Tested by

no test coverage detected