Option 0 for step multiplier makes GC non-incremental

This commit is contained in:
Roberto Ierusalimschy
2023-12-20 11:06:27 -03:00
parent 4eda1acafa
commit 666e95a66d
6 changed files with 84 additions and 50 deletions

View File

@@ -33,7 +33,8 @@ typedef unsigned long lu_mem;
typedef long l_obj;
#endif /* } */
#define MAX_LOBJ cast(l_obj, ~cast(lu_mem, 0) >> 1)
#define MAX_LOBJ \
cast(l_obj, (cast(lu_mem, 1) << (sizeof(l_obj) * CHAR_BIT - 1)) - 1)
/* chars used as small naturals (so that 'char' is reserved for characters) */
@@ -44,7 +45,10 @@ typedef signed char ls_byte;
/* maximum value for size_t */
#define MAX_SIZET ((size_t)(~(size_t)0))
/* maximum size visible for Lua (must be representable in a lua_Integer) */
/*
** Maximum size for strings and userdata visible for Lua (should be
** representable in a lua_Integer)
*/
#define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \
: (size_t)(LUA_MAXINTEGER))