diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-23 17:29:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-23 17:29:03 -0300 |
commit | ec61be9a7e828bfa366a35658b90f53b1ce39478 (patch) | |
tree | 58ca7e26ac48fcbf26136efc2c72e30980f87e40 /llimits.h | |
parent | f356d5acdd9d8e8f7e9d1d7632c4657f945ff4f4 (diff) | |
download | lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.tar.gz lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.tar.bz2 lua-ec61be9a7e828bfa366a35658b90f53b1ce39478.zip |
'l_mem' renamed to 'l_obj' to count objects
Diffstat (limited to 'llimits.h')
-rw-r--r-- | llimits.h | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -16,19 +16,21 @@ | |||
16 | 16 | ||
17 | 17 | ||
18 | /* | 18 | /* |
19 | ** 'lu_mem' and 'l_mem' are unsigned/signed integers big enough to count | 19 | ** 'lu_mem' is an unsigned integer big enough to count the total memory |
20 | ** the total memory used by Lua (in bytes). Usually, 'size_t' and | 20 | ** used by Lua (in bytes). 'l_obj' is a signed integer big enough to |
21 | ** count the total number of objects used by Lua. (It is negative due | ||
22 | ** to the use of debt in several computations.) Usually, 'size_t' and | ||
21 | ** 'ptrdiff_t' should work, but we use 'long' for 16-bit machines. | 23 | ** 'ptrdiff_t' should work, but we use 'long' for 16-bit machines. |
22 | */ | 24 | */ |
23 | #if defined(LUAI_MEM) /* { external definitions? */ | 25 | #if defined(LUAI_MEM) /* { external definitions? */ |
24 | typedef LUAI_UMEM lu_mem; | 26 | typedef LUAI_UMEM lu_mem; |
25 | typedef LUAI_MEM l_mem; | 27 | typedef LUAI_MEM l_obj; |
26 | #elif LUAI_IS32INT /* }{ */ | 28 | #elif LUAI_IS32INT /* }{ */ |
27 | typedef size_t lu_mem; | 29 | typedef size_t lu_mem; |
28 | typedef ptrdiff_t l_mem; | 30 | typedef ptrdiff_t l_obj; |
29 | #else /* 16-bit ints */ /* }{ */ | 31 | #else /* 16-bit ints */ /* }{ */ |
30 | typedef unsigned long lu_mem; | 32 | typedef unsigned long lu_mem; |
31 | typedef long l_mem; | 33 | typedef long l_obj; |
32 | #endif /* } */ | 34 | #endif /* } */ |
33 | 35 | ||
34 | 36 | ||
@@ -47,7 +49,7 @@ typedef signed char ls_byte; | |||
47 | 49 | ||
48 | #define MAX_LUMEM ((lu_mem)(~(lu_mem)0)) | 50 | #define MAX_LUMEM ((lu_mem)(~(lu_mem)0)) |
49 | 51 | ||
50 | #define MAX_LMEM ((l_mem)(MAX_LUMEM >> 1)) | 52 | #define MAX_LMEM ((l_obj)(MAX_LUMEM >> 1)) |
51 | 53 | ||
52 | 54 | ||
53 | #define MAX_INT INT_MAX /* maximum value of an int */ | 55 | #define MAX_INT INT_MAX /* maximum value of an int */ |