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.
This commit is contained in:
Roberto Ierusalimschy
2024-09-10 17:05:39 -03:00
parent a04e0ffdb9
commit 4901853c11
3 changed files with 3 additions and 3 deletions

View File

@@ -216,7 +216,7 @@ static int luaB_collectgarbage (lua_State *L) {
}
case LUA_GCSTEP: {
lua_Integer n = luaL_optinteger(L, 2, 0);
int res = lua_gc(L, o, (int)n);
int res = lua_gc(L, o, cast_sizet(n));
checkvalres(res);
lua_pushboolean(L, res);
return 1;