diff options
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 23 |
1 files changed, 23 insertions, 0 deletions
| @@ -1106,6 +1106,27 @@ static int stacklevel (lua_State *L) { | |||
| 1106 | } | 1106 | } |
| 1107 | 1107 | ||
| 1108 | 1108 | ||
| 1109 | static int resetCI (lua_State *L) { | ||
| 1110 | CallInfo *ci = L->ci; | ||
| 1111 | while (ci->next != NULL) { | ||
| 1112 | CallInfo *tofree = ci->next; | ||
| 1113 | ci->next = ci->next->next; | ||
| 1114 | luaM_free(L, tofree); | ||
| 1115 | L->nci--; | ||
| 1116 | } | ||
| 1117 | return 0; | ||
| 1118 | } | ||
| 1119 | |||
| 1120 | |||
| 1121 | static int reallocstack (lua_State *L) { | ||
| 1122 | int n = cast_int(luaL_checkinteger(L, 1)); | ||
| 1123 | lua_lock(L); | ||
| 1124 | luaD_reallocstack(L, cast_int(L->top.p - L->stack.p) + n, 1); | ||
| 1125 | lua_unlock(L); | ||
| 1126 | return 0; | ||
| 1127 | } | ||
| 1128 | |||
| 1129 | |||
| 1109 | static int table_query (lua_State *L) { | 1130 | static int table_query (lua_State *L) { |
| 1110 | const Table *t; | 1131 | const Table *t; |
| 1111 | int i = cast_int(luaL_optinteger(L, 2, -1)); | 1132 | int i = cast_int(luaL_optinteger(L, 2, -1)); |
| @@ -2182,6 +2203,8 @@ static const struct luaL_Reg tests_funcs[] = { | |||
| 2182 | {"s2d", s2d}, | 2203 | {"s2d", s2d}, |
| 2183 | {"sethook", sethook}, | 2204 | {"sethook", sethook}, |
| 2184 | {"stacklevel", stacklevel}, | 2205 | {"stacklevel", stacklevel}, |
| 2206 | {"resetCI", resetCI}, | ||
| 2207 | {"reallocstack", reallocstack}, | ||
| 2185 | {"sizes", get_sizes}, | 2208 | {"sizes", get_sizes}, |
| 2186 | {"testC", testC}, | 2209 | {"testC", testC}, |
| 2187 | {"makeCfunc", makeCfunc}, | 2210 | {"makeCfunc", makeCfunc}, |
