| 1748 | |
| 1749 | |
| 1750 | void luaK_settablesize (FuncState *fs, int pc, int ra, int asize, int hsize) { |
| 1751 | Instruction *inst = &fs->f->code[pc]; |
| 1752 | int rb = (hsize != 0) ? luaO_ceillog2(hsize) + 1 : 0; /* hash size */ |
| 1753 | int extra = asize / (MAXARG_C + 1); /* higher bits of array size */ |
| 1754 | int rc = asize % (MAXARG_C + 1); /* lower bits of array size */ |
| 1755 | int k = (extra > 0); /* true iff needs extra argument */ |
| 1756 | *inst = CREATE_ABCk(OP_NEWTABLE, ra, rb, rc, k); |
| 1757 | *(inst + 1) = CREATE_Ax(OP_EXTRAARG, extra); |
| 1758 | } |
| 1759 | |
| 1760 | |
| 1761 | /* |
no test coverage detected