diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 16:13:50 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 16:13:50 -0300 |
| commit | 1fb4d539254b67e7e35ed698250c66d1edff0e08 (patch) | |
| tree | 8f48b7ca736a7fb02834bcfac1415cd43307f529 /lobject.c | |
| parent | f6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (diff) | |
| download | lua-github-1fb4d539254b67e7e35ed698250c66d1edff0e08.tar.gz | |
OP_NEWTABLE keeps exact size of arrays
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep
the exact size of the array part of the table to be created.
(Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
Diffstat (limited to 'lobject.c')
| -rw-r--r-- | lobject.c | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -30,32 +30,6 @@ /* -** converts an integer to a "floating point byte", represented as -** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if -** eeeee != 0 and (xxx) otherwise. -*/ -int luaO_int2fb (unsigned int x) { - int e = 0; /* exponent */ - if (x < 8) return x; - while (x >= (8 << 4)) { /* coarse steps */ - x = (x + 0xf) >> 4; /* x = ceil(x / 16) */ - e += 4; - } - while (x >= (8 << 1)) { /* fine steps */ - x = (x + 1) >> 1; /* x = ceil(x / 2) */ - e++; - } - return ((e+1) << 3) | (cast_int(x) - 8); -} - - -/* converts back */ -int luaO_fb2int (int x) { - return (x < 8) ? x : ((x & 7) + 8) << ((x >> 3) - 1); -} - - -/* ** Computes ceil(log2(x)) */ int luaO_ceillog2 (unsigned int x) { |
