From 2f82bf6fe940557fb5258c65c03e18f097ff831f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 24 Nov 2004 16:55:56 -0200 Subject: better support for 64-bit machines --- llimits.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index a07edf92..1c9bc4e6 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.59 2004/06/23 15:57:29 roberto Exp roberto $ +** $Id: llimits.h,v 1.60 2004/09/10 17:30:46 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -18,22 +18,9 @@ typedef LUA_UINT32 lu_int32; -typedef LUA_INT32 l_int32; +typedef LU_MEM lu_mem; - -/* -** an unsigned integer big enough to count the total memory used by Lua; -** it should be at least as large as `size_t' -*/ -typedef lu_int32 lu_mem; - - -/* -** a signed integer big enough to count the total memory used by Lua; -** it should be at least as large as `size_t' -*/ -typedef l_int32 l_mem; -#define MAXLMEM LUA_MAXINT32 +typedef L_MEM l_mem; @@ -43,6 +30,8 @@ typedef unsigned char lu_byte; #define MAX_SIZET ((size_t)(~(size_t)0)-2) +#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) + #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ @@ -51,7 +40,7 @@ typedef unsigned char lu_byte; ** this is for hashing only; there is no problem if the integer ** cannot hold the whole pointer value */ -#define IntPoint(p) ((unsigned int)(p)) +#define IntPoint(p) ((unsigned int)(lu_mem)(p)) -- cgit v1.2.3-55-g6feb