aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ltable.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ltable.c b/ltable.c
index 74feb4bd..3d4f3c38 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.84 2014/01/27 13:34:32 roberto Exp roberto $ 2** $Id: ltable.c,v 2.85 2014/04/01 14:39:55 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -21,6 +21,7 @@
21#include <float.h> 21#include <float.h>
22#include <math.h> 22#include <math.h>
23#include <string.h> 23#include <string.h>
24#include <limits.h>
24 25
25#define ltable_c 26#define ltable_c
26#define LUA_CORE 27#define LUA_CORE
@@ -39,14 +40,13 @@
39 40
40 41
41/* 42/*
42** max size of array part is 2^MAXBITS 43** Maximum size of array part (MAXASIZE) is 2^MAXBITS. (SIZEINT is the
44** minimum between size of int and size of LUA_INTEGER; array indices
45** are limited by both types.)
43*/ 46*/
44#if LUAI_BITSINT >= 32 47#define SIZEINT \
45#define MAXBITS 30 48 (sizeof(int) < sizeof(LUA_INTEGER) ? sizeof(int) : sizeof(LUA_INTEGER))
46#else 49#define MAXBITS cast_int(SIZEINT * CHAR_BIT - 2)
47#define MAXBITS (LUAI_BITSINT-2)
48#endif
49
50#define MAXASIZE (1 << MAXBITS) 50#define MAXASIZE (1 << MAXBITS)
51 51
52 52