diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-18 13:02:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-18 13:02:56 -0300 |
| commit | 60c83ded3080a23bc661ab440c36d0a71b399e2e (patch) | |
| tree | 0aa24b14c1215541b52e7885fd2f2c41aa128a06 /ltests.c | |
| parent | 07948c3181702c55b7b36069ca519b54371a4ab7 (diff) | |
| download | lua-60c83ded3080a23bc661ab440c36d0a71b399e2e.tar.gz lua-60c83ded3080a23bc661ab440c36d0a71b399e2e.tar.bz2 lua-60c83ded3080a23bc661ab440c36d0a71b399e2e.zip | |
small optimization for sizes of array constructors
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.151 2003/01/29 10:27:53 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.152 2003/02/10 17:31:13 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -512,6 +512,13 @@ static int log2_aux (lua_State *L) { | |||
| 512 | return 1; | 512 | return 1; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static int int2fb_aux (lua_State *L) { | ||
| 516 | int b = luaO_int2fb(luaL_checkint(L, 1)); | ||
| 517 | lua_pushnumber(L, b); | ||
| 518 | lua_pushnumber(L, fb2int(b)); | ||
| 519 | return 2; | ||
| 520 | } | ||
| 521 | |||
| 515 | 522 | ||
| 516 | static int test_do (lua_State *L) { | 523 | static int test_do (lua_State *L) { |
| 517 | const char *p = luaL_checkstring(L, 1); | 524 | const char *p = luaL_checkstring(L, 1); |
| @@ -790,6 +797,7 @@ static const struct luaL_reg tests_funcs[] = { | |||
| 790 | {"closestate", closestate}, | 797 | {"closestate", closestate}, |
| 791 | {"doremote", doremote}, | 798 | {"doremote", doremote}, |
| 792 | {"log2", log2_aux}, | 799 | {"log2", log2_aux}, |
| 800 | {"int2fb", int2fb_aux}, | ||
| 793 | {"totalmem", mem_query}, | 801 | {"totalmem", mem_query}, |
| 794 | {"resume", coresume}, | 802 | {"resume", coresume}, |
| 795 | {"setyhook", setyhook}, | 803 | {"setyhook", setyhook}, |
