aboutsummaryrefslogtreecommitdiff
path: root/inout.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-05-26 11:42:51 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-05-26 11:42:51 -0300
commite1249970c2d058d173e7b1c1dc7deab1ccd68b7d (patch)
tree7692598a31f8cb2da8902daf705cb8ba0915bed0 /inout.c
parent9d6f4e48a663691cdf1612f14ca7c66b608f98f7 (diff)
downloadlua-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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/inout.c b/inout.c
index 6b3e490f..d0bd707e 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
5** Also provides some predefined lua functions. 5** Also provides some predefined lua functions.
6*/ 6*/
7 7
8char *rcs_inout="$Id: inout.c,v 2.57 1997/04/06 14:14:27 roberto Exp roberto $"; 8char *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
313static 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},