From ddfa1fbccfe4c1ec69f7396a4f5842abe70927ba Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 19 Sep 2024 19:02:14 -0300 Subject: GC back to controling pace counting bytes Memory is the resource we want to save. Still to be reviewed again. --- llimits.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index d7ae065b..f189048c 100644 --- a/llimits.h +++ b/llimits.h @@ -16,25 +16,24 @@ /* -** 'lu_mem' is an unsigned integer big enough to count the total memory -** used by Lua (in bytes). 'l_obj' is a signed integer big enough to -** count the total number of objects used by Lua. (It is signed due -** to the use of debt in several computations.) Usually, 'size_t' and -** 'ptrdiff_t' should work, but we use 'long' for 16-bit machines. +** 'l_mem' is a signed integer big enough to count the total memory +** used by Lua. (It is signed due to the use of debt in several +** computations.) Usually, 'ptrdiff_t' should work, but we use 'long' +** for 16-bit machines. */ #if defined(LUAI_MEM) /* { external definitions? */ +typedef LUAI_MEM l_mem; typedef LUAI_UMEM lu_mem; -typedef LUAI_MEM l_obj; #elif LUAI_IS32INT /* }{ */ +typedef ptrdiff_t l_mem; typedef size_t lu_mem; -typedef ptrdiff_t l_obj; #else /* 16-bit ints */ /* }{ */ +typedef long l_mem; typedef unsigned long lu_mem; -typedef long l_obj; #endif /* } */ -#define MAX_LOBJ \ - cast(l_obj, (cast(lu_mem, 1) << (sizeof(l_obj) * CHAR_BIT - 1)) - 1) +#define MAX_LMEM \ + cast(l_mem, (cast(lu_mem, 1) << (sizeof(l_mem) * 8 - 1)) - 1) /* chars used as small naturals (so that 'char' is reserved for characters) */ -- cgit v1.2.3-55-g6feb