46 #define MAXABITS cast_int(sizeof(int) * CHAR_BIT - 1) 54 #define MAXASIZE luaM_limitN(1u << MAXABITS, TValue) 60 #define MAXHBITS (MAXABITS - 1) 68 #define MAXHSIZE luaM_limitN(1u << MAXHBITS, Node) 71 #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) 73 #define hashstr(t,str) hashpow2(t, (str)->hash) 74 #define hashboolean(t,p) hashpow2(t, p) 75 #define hashint(t,i) hashpow2(t, i) 82 #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) 85 #define hashpointer(t,p) hashmod(t, point2uint(p)) 88 #define dummynode (&dummynode_) 113 #if !defined(l_hashfloat) 203 #define limitequalsasize(t) (isrealasize(t) || ispow2((t)->alimit)) 213 unsigned int size = t->
alimit;
219 size |= (size >> 16);
220 #if (UINT_MAX >> 30) > 3 221 size |= (size >> 32);
247 #define limitasasize(t) check_exp(isrealasize(t), t->alimit) 288 unsigned int asize) {
300 return (i + 1) + asize;
308 for (; i < asize; i++) {
347 static unsigned int computesizes (
unsigned int nums[],
unsigned int *pna) {
352 unsigned int optimal = 0;
354 for (i = 0, twotoi = 1;
355 twotoi > 0 && *pna > twotoi / 2;
363 lua_assert((optimal == 0 || optimal / 2 < na) && na <= optimal);
388 unsigned int ause = 0;
392 for (lg = 0, ttlg = 1; lg <=
MAXABITS; lg++, ttlg *= 2) {
394 unsigned int lim = ttlg;
401 for (; i <= lim; i++) {
449 for (i = 0; i < (int)size; i++) {
467 for (j = 0; j < size; j++) {
510 unsigned int nhsize) {
517 if (newasize < oldasize) {
521 for (i = newasize; i < oldasize; i++) {
530 if (
unlikely(newarray == NULL && newasize > 0)) {
538 for (i = oldasize; i < newasize; i++)
560 for (i = 0; i <=
MAXABITS; i++) nums[i] = 0;
649 while (othern +
gnext(othern) != mp)
650 othern +=
gnext(othern);
653 if (
gnext(mp) != 0) {
685 return &t->
array[key - 1];
690 return &t->
array[key - 1];
825 unsigned int m = (i + j) / 2;
826 if (
isempty(&array[m - 1])) j = m;
866 unsigned int limit = t->
alimit;
914 #if defined(LUA_DEBUG) 922 int luaH_isdummy (
const Table *t) {
return isdummy(t); }
static lua_Unsigned hash_search(Table *t, lua_Unsigned j)
enum MQTTPropertyCodes value
#define hashboolean(t, p)
#define luaM_newvector(L, n, t)
#define luaM_freearray(L, b, n)
static void freehash(lua_State *L, Table *t)
const TValue * luaH_getint(Table *t, lua_Integer key)
static Node * mainpositionTV(const Table *t, const TValue *key)
unsigned int luaS_hashlongstr(TString *ts)
static int equalkey(const TValue *k1, const Node *n2)
#define hashpointer(t, p)
#define setnodekey(L, node, obj)
const TValue * luaH_getstr(Table *t, TString *key)
void luaH_free(lua_State *L, Table *t)
static unsigned int binsearch(const TValue *array, unsigned int i, unsigned int j)
#define getnodekey(L, obj, node)
const TValue * luaH_getshortstr(Table *t, TString *key)
static int l_hashfloat(lua_Number n)
static int countint(lua_Integer key, unsigned int *nums)
#define luaM_reallocvector(L, v, oldn, n, t)
static const Node dummynode_
static void reinsert(lua_State *L, Table *ot, Table *t)
TValue * luaH_newkey(lua_State *L, Table *t, const TValue *key)
static int ispow2realasize(const Table *t)
int luaO_ceillog2(unsigned int x)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
#define lua_numbertointeger(n, p)
static void setnodevector(lua_State *L, Table *t, unsigned int size)
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
#define LUA_VLIGHTUSERDATA
static unsigned int numusearray(const Table *t, unsigned int *nums)
Table * luaH_new(lua_State *L)
#define keyisinteger(node)
static Node * getfreepos(Table *t)
static int numusehash(const Table *t, unsigned int *nums, unsigned int *pna)
static unsigned int setlimittosize(Table *t)
lua_Unsigned luaH_getn(Table *t)
#define setivalue(obj, x)
static unsigned int findindex(lua_State *L, Table *t, TValue *key, unsigned int asize)
static unsigned int computesizes(unsigned int nums[], unsigned int *pna)
static void exchangehashpart(Table *t1, Table *t2)
static Node * mainposition(const Table *t, int ktt, const Value *kvl)
static const TValue absentkey
void luaH_resizearray(lua_State *L, Table *t, unsigned int nasize)
#define luaC_barrierback(L, p, v)
LUA_UNSIGNED lua_Unsigned
int luaV_flttointeger(lua_Number n, lua_Integer *p, F2Imod mode)
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
int luaH_next(lua_State *L, Table *t, StkId key)
#define limitequalsasize(t)
LUAI_FUNC unsigned int luaH_realasize(const Table *t)
static unsigned int arrayindex(lua_Integer k)
#define keyisshrstr(node)
const TValue * luaH_get(Table *t, const TValue *key)
int luaS_eqlngstr(TString *a, TString *b)
static void rehash(lua_State *L, Table *t, const TValue *ek)
#define setobj2s(L, o1, o2)
#define setnorealasize(t)
static const TValue * getgeneric(Table *t, const TValue *key)
#define setsvalue(L, obj, x)