44#define MAXBITS (LUAI_BITSINT-2)
47#define MAXASIZE (1 << MAXBITS)
50#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
52#define hashstr(t,str) hashpow2(t, (str)->tsv.hash)
53#define hashboolean(t,p) hashpow2(t, p)
60#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
63#define hashpointer(t,p) hashmod(t, IntPoint(p))
69#define numints cast_int(sizeof(lua_Number)/sizeof(int))
73#define dummynode (&dummynode_)
89 memcpy(
a, &n,
sizeof(
a));
90 for (i = 1; i <
numints; i++)
a[0] +=
a[i];
101 switch (
ttype(key)) {
141 if (0 < i && i <= t->sizearray)
195 for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) {
203 if (
a == *narray)
break;
227 for (lg=0, ttlg=1; lg<=
MAXBITS; lg++, ttlg*=2) {
236 for (; i <= lim; i++) {
285 for (i=0; i<size; i++) {
302 if (nasize > oldasize)
306 if (nasize < oldasize) {
309 for (i=nasize; i<oldasize; i++) {
317 for (i =
twoto(oldhsize) - 1; i >= 0; i--) {
329 resize(L, t, nasize, nsize);
338 for (i=0; i<=
MAXBITS; i++) nums[i] = 0;
348 resize(L, t, nasize, totaluse - na);
412 while (
gnext(othern) != mp) othern =
gnext(othern);
425 gkey(mp)->value = key->value;
gkey(mp)->tt = key->tt;
438 return &t->
array[key-1];
470 switch (
ttype(key)) {
548 unsigned int m = (i+j)/2;
566 unsigned int m = (i+j)/2;
580#if defined(LUA_DEBUG)
void luaG_runerror(lua_State *L, const char *fmt,...)
void luaC_link(lua_State *L, GCObject *o, lu_byte tt)
#define luaC_barriert(L, t, v)
#define luaM_freearray(L, b, n, t)
#define luaM_newvector(L, n, t)
#define luaM_reallocvector(L, v, oldn, n, t)
int luaO_rawequalObj(const TValue *t1, const TValue *t2)
#define setsvalue(L, obj, x)
#define setnvalue(obj, x)
static int countint(const TValue *key, int *nums)
const TValue * luaH_get(Table *t, const TValue *key)
TValue * luaH_setnum(lua_State *L, Table *t, int key)
Table * luaH_new(lua_State *L, int narray, int nhash)
static TValue * newkey(lua_State *L, Table *t, const TValue *key)
const TValue * luaH_getnum(Table *t, int key)
static Node * getfreepos(Table *t)
static int unbound_search(Table *t, unsigned int j)
const TValue * luaH_getstr(Table *t, TString *key)
static void setarrayvector(lua_State *L, Table *t, int size)
int luaH_next(lua_State *L, Table *t, StkId key)
static int findindex(lua_State *L, Table *t, StkId key)
static void resize(lua_State *L, Table *t, int nasize, int nhsize)
void luaH_resizearray(lua_State *L, Table *t, int nasize)
static int computesizes(int nums[], int *narray)
static int numusearray(const Table *t, int *nums)
#define hashboolean(t, p)
static const Node dummynode_
static int arrayindex(const TValue *key)
static Node * hashnum(const Table *t, lua_Number n)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
static Node * mainposition(const Table *t, const TValue *key)
#define hashpointer(t, p)
void luaH_free(lua_State *L, Table *t)
TValue * luaH_setstr(lua_State *L, Table *t, TString *key)
static int numusehash(const Table *t, int *nums, int *pnasize)
static void setnodevector(lua_State *L, Table *t, int size)
static void rehash(lua_State *L, Table *t, const TValue *ek)
#define LUA_TLIGHTUSERDATA
#define lua_number2int(i, d)