Parameter for lua_gc/LUA_GCSTEP changed to 'size_t' · lua/lua@4901853 · GitHub
Skip to content

Commit 4901853

Browse files
committed
Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'
'size_t' is the common type for measuring memory. 'int' can be too small for steps.
1 parent a04e0ff commit 4901853

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎lapi.c‎

Lines changed: 1 addition & 1 deletion

‎lbaselib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static int luaB_collectgarbage (lua_State *L) {
216216
}
217217
case LUA_GCSTEP: {
218218
lua_Integer n = luaL_optinteger(L, 2, 0);
219-
int res = lua_gc(L, o, (int)n);
219+
int res = lua_gc(L, o, cast_sizet(n));
220220
checkvalres(res);
221221
lua_pushboolean(L, res);
222222
return 1;

‎manual/manual.of‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)