diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 11 |
1 files changed, 10 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.9 2004/05/14 19:25:09 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.10 2004/05/31 19:41:52 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -833,6 +833,15 @@ LUA_API int lua_gc (lua_State *L, int what, int data) { | |||
| 833 | /* GC values are expressed in Kbytes: #bytes/2^10 */ | 833 | /* GC values are expressed in Kbytes: #bytes/2^10 */ |
| 834 | return cast(int, g->nblocks >> 10); | 834 | return cast(int, g->nblocks >> 10); |
| 835 | } | 835 | } |
| 836 | case LUA_GCSTEP: { | ||
| 837 | lu_mem a = (cast(lu_mem, data) << 10); | ||
| 838 | if (a <= g->nblocks) | ||
| 839 | g->GCthreshold = g->nblocks - a; | ||
| 840 | else | ||
| 841 | g->GCthreshold = 0; | ||
| 842 | luaC_step(L); | ||
| 843 | return 0; | ||
| 844 | } | ||
| 836 | default: return -1; /* invalid option */ | 845 | default: return -1; /* invalid option */ |
| 837 | } | 846 | } |
| 838 | } | 847 | } |
