diff options
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 31 |
1 files changed, 18 insertions, 13 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llimits.h,v 1.51 2002/11/25 17:47:13 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.52 2003/02/20 19:33:23 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 | */ |
| @@ -40,20 +40,25 @@ | |||
| 40 | ** any machine, but may not be optimal. | 40 | ** any machine, but may not be optimal. |
| 41 | */ | 41 | */ |
| 42 | 42 | ||
| 43 | /* an unsigned integer to hold hash values */ | ||
| 44 | typedef unsigned int lu_hash; | ||
| 45 | /* its signed equivalent */ | ||
| 46 | typedef int ls_hash; | ||
| 47 | 43 | ||
| 48 | /* an unsigned integer big enough to count the total memory used by Lua; */ | 44 | /* |
| 49 | /* it should be at least as large as size_t */ | 45 | ** an unsigned integer with at least 32 bits |
| 50 | typedef unsigned long lu_mem; | 46 | */ |
| 47 | #ifndef LUA_UINT32 | ||
| 48 | #define LUA_UINT32 unsigned long | ||
| 49 | #endif | ||
| 50 | |||
| 51 | typedef LUA_UINT32 lu_int32; | ||
| 51 | 52 | ||
| 52 | #define MAX_LUMEM ULONG_MAX | ||
| 53 | 53 | ||
| 54 | /* | ||
| 55 | ** an unsigned integer big enough to count the total memory used by Lua; | ||
| 56 | ** it should be at least as large as `size_t' | ||
| 57 | */ | ||
| 58 | typedef lu_int32 lu_mem; | ||
| 59 | |||
| 60 | #define MAX_LUMEM ULONG_MAX | ||
| 54 | 61 | ||
| 55 | /* an integer big enough to count the number of strings in use */ | ||
| 56 | typedef long ls_nstr; | ||
| 57 | 62 | ||
| 58 | /* chars used as small naturals (so that `char' is reserved for characters) */ | 63 | /* chars used as small naturals (so that `char' is reserved for characters) */ |
| 59 | typedef unsigned char lu_byte; | 64 | typedef unsigned char lu_byte; |
| @@ -69,7 +74,7 @@ typedef unsigned char lu_byte; | |||
| 69 | ** this is for hashing only; there is no problem if the integer | 74 | ** this is for hashing only; there is no problem if the integer |
| 70 | ** cannot hold the whole pointer value | 75 | ** cannot hold the whole pointer value |
| 71 | */ | 76 | */ |
| 72 | #define IntPoint(p) ((lu_hash)(p)) | 77 | #define IntPoint(p) ((unsigned int)(p)) |
| 73 | 78 | ||
| 74 | 79 | ||
| 75 | 80 | ||
| @@ -114,7 +119,7 @@ typedef LUA_UACNUMBER l_uacNumber; | |||
| 114 | ** type for virtual-machine instructions | 119 | ** type for virtual-machine instructions |
| 115 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) | 120 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) |
| 116 | */ | 121 | */ |
| 117 | typedef unsigned long Instruction; | 122 | typedef lu_int32 Instruction; |
| 118 | 123 | ||
| 119 | 124 | ||
| 120 | /* maximum depth for calls (unsigned short) */ | 125 | /* maximum depth for calls (unsigned short) */ |
