diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-05-26 11:42:51 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-05-26 11:42:51 -0300 |
commit | e1249970c2d058d173e7b1c1dc7deab1ccd68b7d (patch) | |
tree | 7692598a31f8cb2da8902daf705cb8ba0915bed0 /inout.c | |
parent | 9d6f4e48a663691cdf1612f14ca7c66b608f98f7 (diff) | |
download | lua-e1249970c2d058d173e7b1c1dc7deab1ccd68b7d.tar.gz lua-e1249970c2d058d173e7b1c1dc7deab1ccd68b7d.tar.bz2 lua-e1249970c2d058d173e7b1c1dc7deab1ccd68b7d.zip |
new API function to force garbage collection.
Diffstat (limited to 'inout.c')
-rw-r--r-- | inout.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -5,7 +5,7 @@ | |||
5 | ** Also provides some predefined lua functions. | 5 | ** Also provides some predefined lua functions. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | char *rcs_inout="$Id: inout.c,v 2.57 1997/04/06 14:14:27 roberto Exp roberto $"; | 8 | char *rcs_inout="$Id: inout.c,v 2.58 1997/04/15 17:32:47 roberto Exp roberto $"; |
9 | 9 | ||
10 | #include <stdio.h> | 10 | #include <stdio.h> |
11 | #include <string.h> | 11 | #include <string.h> |
@@ -310,6 +310,11 @@ static void rawsettable (void) | |||
310 | } | 310 | } |
311 | 311 | ||
312 | 312 | ||
313 | static void luaI_collectgarbage (void) | ||
314 | { | ||
315 | lua_pushnumber(lua_collectgarbage(luaL_opt_number(1, 0))); | ||
316 | } | ||
317 | |||
313 | 318 | ||
314 | /* | 319 | /* |
315 | ** Internal functions | 320 | ** Internal functions |
@@ -320,6 +325,7 @@ static struct { | |||
320 | } int_funcs[] = { | 325 | } int_funcs[] = { |
321 | {"assert", luaI_assert}, | 326 | {"assert", luaI_assert}, |
322 | {"call", luaI_call}, | 327 | {"call", luaI_call}, |
328 | {"callgc", luaI_collectgarbage}, | ||
323 | {"dofile", lua_internaldofile}, | 329 | {"dofile", lua_internaldofile}, |
324 | {"dostring", lua_internaldostring}, | 330 | {"dostring", lua_internaldostring}, |
325 | {"error", luaI_error}, | 331 | {"error", luaI_error}, |