diff options
Diffstat (limited to 'llimits.h')
-rw-r--r-- | llimits.h | 23 |
1 files changed, 6 insertions, 17 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.59 2004/06/23 15:57:29 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.60 2004/09/10 17:30:46 roberto Exp roberto $ |
3 | ** Limits, basic types, and some other `installation-dependent' definitions | 3 | ** Limits, basic types, and some other `installation-dependent' definitions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -18,22 +18,9 @@ | |||
18 | 18 | ||
19 | typedef LUA_UINT32 lu_int32; | 19 | typedef LUA_UINT32 lu_int32; |
20 | 20 | ||
21 | typedef LUA_INT32 l_int32; | 21 | typedef LU_MEM lu_mem; |
22 | 22 | ||
23 | 23 | typedef L_MEM l_mem; | |
24 | /* | ||
25 | ** an unsigned integer big enough to count the total memory used by Lua; | ||
26 | ** it should be at least as large as `size_t' | ||
27 | */ | ||
28 | typedef lu_int32 lu_mem; | ||
29 | |||
30 | |||
31 | /* | ||
32 | ** a signed integer big enough to count the total memory used by Lua; | ||
33 | ** it should be at least as large as `size_t' | ||
34 | */ | ||
35 | typedef l_int32 l_mem; | ||
36 | #define MAXLMEM LUA_MAXINT32 | ||
37 | 24 | ||
38 | 25 | ||
39 | 26 | ||
@@ -43,6 +30,8 @@ typedef unsigned char lu_byte; | |||
43 | 30 | ||
44 | #define MAX_SIZET ((size_t)(~(size_t)0)-2) | 31 | #define MAX_SIZET ((size_t)(~(size_t)0)-2) |
45 | 32 | ||
33 | #define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) | ||
34 | |||
46 | 35 | ||
47 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ | 36 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ |
48 | 37 | ||
@@ -51,7 +40,7 @@ typedef unsigned char lu_byte; | |||
51 | ** this is for hashing only; there is no problem if the integer | 40 | ** this is for hashing only; there is no problem if the integer |
52 | ** cannot hold the whole pointer value | 41 | ** cannot hold the whole pointer value |
53 | */ | 42 | */ |
54 | #define IntPoint(p) ((unsigned int)(p)) | 43 | #define IntPoint(p) ((unsigned int)(lu_mem)(p)) |
55 | 44 | ||
56 | 45 | ||
57 | 46 | ||