aboutsummaryrefslogtreecommitdiff
path: root/llimits.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-23 17:29:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-23 17:29:03 -0300
commitec61be9a7e828bfa366a35658b90f53b1ce39478 (patch)
tree58ca7e26ac48fcbf26136efc2c72e30980f87e40 /llimits.h
parentf356d5acdd9d8e8f7e9d1d7632c4657f945ff4f4 (diff)
downloadlua-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.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/llimits.h b/llimits.h
index ef108f5f..525b3647 100644
--- a/llimits.h
+++ b/llimits.h
@@ -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? */
24typedef LUAI_UMEM lu_mem; 26typedef LUAI_UMEM lu_mem;
25typedef LUAI_MEM l_mem; 27typedef LUAI_MEM l_obj;
26#elif LUAI_IS32INT /* }{ */ 28#elif LUAI_IS32INT /* }{ */
27typedef size_t lu_mem; 29typedef size_t lu_mem;
28typedef ptrdiff_t l_mem; 30typedef ptrdiff_t l_obj;
29#else /* 16-bit ints */ /* }{ */ 31#else /* 16-bit ints */ /* }{ */
30typedef unsigned long lu_mem; 32typedef unsigned long lu_mem;
31typedef long l_mem; 33typedef 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 */