diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -1033,16 +1033,35 @@ static int table_query (lua_State *L) { | |||
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | 1035 | ||
1036 | static int query_inc (lua_State *L) { | 1036 | static int query_GCparams (lua_State *L) { |
1037 | global_State *g = G(L); | 1037 | global_State *g = G(L); |
1038 | lua_pushinteger(L, gettotalobjs(g)); | 1038 | lua_pushinteger(L, gettotalobjs(g)); |
1039 | lua_pushinteger(L, g->GCdebt); | 1039 | lua_pushinteger(L, g->GCdebt); |
1040 | lua_pushinteger(L, applygcparam(g, gcpause, 100)); | 1040 | lua_pushinteger(L, luaO_applyparam(g->gcpgenminormul, 100)); |
1041 | lua_pushinteger(L, applygcparam(g, gcstepmul, 100)); | 1041 | lua_pushinteger(L, luaO_applyparam(g->gcpmajorminor, 100)); |
1042 | lua_pushinteger(L, cast(l_obj, 1) << g->gcstepsize); | 1042 | lua_pushinteger(L, luaO_applyparam(g->gcpminormajor, 100)); |
1043 | return 5; | 1043 | lua_pushinteger(L, luaO_applyparam(g->gcppause, 100)); |
1044 | lua_pushinteger(L, luaO_applyparam(g->gcpstepmul, 100)); | ||
1045 | lua_pushinteger(L, luaO_applyparam(g->gcpstepsize, 100)); | ||
1046 | return 8; | ||
1047 | } | ||
1048 | |||
1049 | |||
1050 | static int test_codeparam (lua_State *L) { | ||
1051 | lua_Integer p = luaL_checkinteger(L, 1); | ||
1052 | lua_pushinteger(L, luaO_codeparam(p)); | ||
1053 | return 1; | ||
1044 | } | 1054 | } |
1045 | 1055 | ||
1056 | |||
1057 | static int test_applyparam (lua_State *L) { | ||
1058 | lua_Integer p = luaL_checkinteger(L, 1); | ||
1059 | lua_Integer x = luaL_checkinteger(L, 2); | ||
1060 | lua_pushinteger(L, luaO_applyparam(p, x)); | ||
1061 | return 1; | ||
1062 | } | ||
1063 | |||
1064 | |||
1046 | static int string_query (lua_State *L) { | 1065 | static int string_query (lua_State *L) { |
1047 | stringtable *tb = &G(L)->strt; | 1066 | stringtable *tb = &G(L)->strt; |
1048 | int s = cast_int(luaL_optinteger(L, 1, 0)) - 1; | 1067 | int s = cast_int(luaL_optinteger(L, 1, 0)) - 1; |
@@ -1974,7 +1993,9 @@ static const struct luaL_Reg tests_funcs[] = { | |||
1974 | {"pushuserdata", pushuserdata}, | 1993 | {"pushuserdata", pushuserdata}, |
1975 | {"querystr", string_query}, | 1994 | {"querystr", string_query}, |
1976 | {"querytab", table_query}, | 1995 | {"querytab", table_query}, |
1977 | {"queryinc", query_inc}, | 1996 | {"queryGCparams", query_GCparams}, |
1997 | {"codeparam", test_codeparam}, | ||
1998 | {"applyparam", test_applyparam}, | ||
1978 | {"ref", tref}, | 1999 | {"ref", tref}, |
1979 | {"resume", coresume}, | 2000 | {"resume", coresume}, |
1980 | {"s2d", s2d}, | 2001 | {"s2d", s2d}, |