diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-20 17:12:39 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-20 17:12:39 -0300 |
commit | 67f9a2a98f245f3468f1671bb1f51ffabb4581be (patch) | |
tree | fa3453c1c6f8fe00f6c327e277a02ea72ebb8138 /lapi.c | |
parent | c4f9c887fc8dc514b9de30ce395517caad973246 (diff) | |
download | lua-67f9a2a98f245f3468f1671bb1f51ffabb4581be.tar.gz lua-67f9a2a98f245f3468f1671bb1f51ffabb4581be.tar.bz2 lua-67f9a2a98f245f3468f1671bb1f51ffabb4581be.zip |
details
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.228 2003/02/11 10:46:24 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.229 2003/02/18 16:13:15 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 | */ |
@@ -755,7 +755,7 @@ LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data) { | |||
755 | /* GC values are expressed in Kbytes: #bytes/2^10 */ | 755 | /* GC values are expressed in Kbytes: #bytes/2^10 */ |
756 | #define GCscalel(x) ((x)>>10) | 756 | #define GCscalel(x) ((x)>>10) |
757 | #define GCscale(x) (cast(int, GCscalel(x))) | 757 | #define GCscale(x) (cast(int, GCscalel(x))) |
758 | #define GCunscale(x) (cast(lu_mem, (x)<<10)) | 758 | #define GCunscale(x) (cast(lu_mem, x)<<10) |
759 | 759 | ||
760 | LUA_API int lua_getgcthreshold (lua_State *L) { | 760 | LUA_API int lua_getgcthreshold (lua_State *L) { |
761 | int threshold; | 761 | int threshold; |
@@ -775,8 +775,8 @@ LUA_API int lua_getgccount (lua_State *L) { | |||
775 | 775 | ||
776 | LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold) { | 776 | LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold) { |
777 | lua_lock(L); | 777 | lua_lock(L); |
778 | if (cast(lu_mem, newthreshold) > GCscalel(ULONG_MAX)) | 778 | if (cast(lu_mem, newthreshold) > GCscalel(MAX_LUMEM)) |
779 | G(L)->GCthreshold = ULONG_MAX; | 779 | G(L)->GCthreshold = MAX_LUMEM; |
780 | else | 780 | else |
781 | G(L)->GCthreshold = GCunscale(newthreshold); | 781 | G(L)->GCthreshold = GCunscale(newthreshold); |
782 | luaC_checkGC(L); | 782 | luaC_checkGC(L); |