45 #define MAXBITS (BITS_INT-2)
49 #define toobig(x) ((((x)-1) >> MAXBITS) != 0)
53 #ifndef lua_number2int
54 #define lua_number2int(i,n) ((i)=(int)(n))
58 #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
60 #define hashstr(t,str) hashpow2(t, (str)->tsv.hash)
61 #define hashboolean(t,p) hashpow2(t, p)
68 #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
71 #define hashpointer(t,p) hashmod(t, IntPoint(p))
77 #define numints cast(int, sizeof(lua_Number)/sizeof(int))
90 memcpy(a, &n,
sizeof(a));
91 for (i = 1; i <
numints; i++) a[0] += a[i];
102 switch (
ttype(key)) {
109 case LUA_TLIGHTUSERDATA:
145 if (0 <= i && i <= t->sizearray) {
186 static void computesizes (
int nums[],
int ntotal,
int *narray,
int *nhash)
192 int n = (na == 0) ? -1 : 0;
193 for (i = 1; a < *narray && *narray >=
twoto(i-1); i++) {
196 if (a >=
twoto(i-1)) {
202 lua_assert(na <= *narray && *narray <= ntotal);
203 *nhash = ntotal - na;
204 *narray = (n == -1) ? 0 :
twoto(n);
216 for (i=0, lg=0; lg<=
MAXBITS; lg++) {
217 int ttlg =
twoto(lg);
220 if (i >= ttlg)
break;
223 for (; i<ttlg; i++) {
230 for (; lg<=
MAXBITS; lg++) nums[lg] = 0;
264 int size =
twoto(lsize);
268 t->
node =
G(L)->dummynode;
275 for (i=0; i<size; i++) {
298 temp[0] = t->
node[0];
304 if (nasize > oldasize)
309 if (nasize < oldasize) {
312 for (i=nasize; i<oldasize; i++) {
320 for (i =
twoto(oldhsize) - 1; i >= 0; i--) {
334 numuse(t, &nasize, &nhsize);
377 while (mp->
next != e) mp = mp->
next;
381 if (e->
next != NULL) ??
407 while (othern->
next != mp) othern = othern->
next;
463 if (1 <= key && key <= t->sizearray)
464 return &t->
array[key-1];
466 lua_Number nk =
cast(lua_Number, key);
496 switch (
ttype(key)) {