Go to the documentation of this file.
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)
75 #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
81 #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
84 #define hashstr(t,str) hashpow2(t, (str)->hash)
85 #define hashboolean(t,p) hashpow2(t, p)
87 #define hashint(t,i) hashpow2(t, i)
90 #define hashpointer(t,p) hashmod(t, point2uint(p))
93 #define dummynode (&dummynode_)
118 #if !defined(l_hashfloat)
122 n = l_mathop(frexp)(n, &i) * -
cast_num(INT_MIN);
235 #define limitequalsasize(t) (isrealasize(t) || ispow2((t)->alimit))
252 #if (UINT_MAX >> 30) > 3
279 #define limitasasize(t) check_exp(isrealasize(t), t->alimit)
321 unsigned int asize) {
333 return (i + 1) + asize;
341 for (; i < asize; i++) {
380 static unsigned int computesizes (
unsigned int nums[],
unsigned int *pna) {
385 unsigned int optimal = 0;
387 for (i = 0, twotoi = 1;
388 twotoi > 0 && *pna > twotoi / 2;
396 lua_assert((optimal == 0 || optimal / 2 < na) && na <= optimal);
421 unsigned int ause = 0;
425 for (lg = 0, ttlg = 1; lg <=
MAXABITS; lg++, ttlg *= 2) {
427 unsigned int lim = ttlg;
434 for (; i <= lim; i++) {
482 for (i = 0; i < (
int)
size; i++) {
500 for (j = 0; j <
size; j++) {
543 unsigned int nhsize) {
550 if (newasize < oldasize) {
554 for (i = newasize; i < oldasize; i++) {
563 if (l_unlikely(newarray == NULL && newasize > 0)) {
571 for (i = oldasize; i < newasize; i++)
593 for (i = 0; i <=
MAXABITS; i++) nums[i] = 0;
685 while (othern +
gnext(othern) != mp)
686 othern +=
gnext(othern);
689 if (
gnext(mp) != 0) {
721 return &t->
array[key - 1];
726 return &t->
array[key - 1];
872 unsigned int m = (i + j) / 2;
873 if (
isempty(&array[m - 1])) j = m;
913 unsigned int limit = t->
alimit;
961 #if defined(LUA_DEBUG)
969 int luaH_isdummy (
const Table *t) {
return isdummy(t); }
GCObject * luaC_newobj(lua_State *L, int tt, size_t sz)
LUA_UNSIGNED lua_Unsigned
void luaH_free(lua_State *L, Table *t)
#define setsvalue(L, obj, x)
#define hashpointer(t, p)
void luaH_newkey(lua_State *L, Table *t, const TValue *key, TValue *value)
static void rehash(lua_State *L, Table *t, const TValue *ek)
#define setnorealasize(t)
#define luaC_barrierback(L, p, v)
#define setnodekey(L, node, obj)
#define limitequalsasize(t)
l_noret luaG_runerror(lua_State *L, const char *fmt,...)
static Node * mainpositionTV(const Table *t, const TValue *key)
#define getnodekey(L, obj, node)
const TValue * luaH_getint(Table *t, lua_Integer key)
static void reinsert(lua_State *L, Table *ot, Table *t)
const TValue * luaH_getshortstr(Table *t, TString *key)
#define luaM_newvector(L, n, t)
void luaH_resize(lua_State *L, Table *t, unsigned int newasize, unsigned int nhsize)
void luaH_resizearray(lua_State *L, Table *t, unsigned int nasize)
void luaH_set(lua_State *L, Table *t, const TValue *key, TValue *value)
span_constexpr std::size_t size(span< T, Extent > const &spn)
static int countint(lua_Integer key, unsigned int *nums)
static unsigned int findindex(lua_State *L, Table *t, TValue *key, unsigned int asize)
static void setnodevector(lua_State *L, Table *t, unsigned int size)
static unsigned int binsearch(const TValue *array, unsigned int i, unsigned int j)
static unsigned int numusearray(const Table *t, unsigned int *nums)
int luaO_ceillog2(unsigned int x)
const TValue * luaH_get(Table *t, const TValue *key)
unsigned int luaS_hashlongstr(TString *ts)
#define lua_numbertointeger(n, p)
static int equalkey(const TValue *k1, const Node *n2, int deadok)
static int l_hashfloat(lua_Number n)
int luaV_flttointeger(lua_Number n, lua_Integer *p, F2Imod mode)
static const TValue * getgeneric(Table *t, const TValue *key, int deadok)
const TValue * luaH_getstr(Table *t, TString *key)
static void exchangehashpart(Table *t1, Table *t2)
LUAI_FUNC unsigned int luaH_realasize(const Table *t)
static lua_Unsigned hash_search(Table *t, lua_Unsigned j)
Table * luaH_new(lua_State *L)
static const Node dummynode_
#define LUA_VLIGHTUSERDATA
#define hashboolean(t, p)
#define keyisinteger(node)
#define luaM_reallocvector(L, v, oldn, n, t)
lua_Unsigned luaH_getn(Table *t)
static unsigned int setlimittosize(Table *t)
void luaH_setint(lua_State *L, Table *t, lua_Integer key, TValue *value)
int luaH_next(lua_State *L, Table *t, StkId key)
#define setivalue(obj, x)
static unsigned int arrayindex(lua_Integer k)
static const TValue absentkey
static void freehash(lua_State *L, Table *t)
static Node * getfreepos(Table *t)
#define setobj2s(L, o1, o2)
int(* lua_CFunction)(lua_State *L)
#define luaM_freearray(L, b, n)
static Node * mainposition(const Table *t, int ktt, const Value *kvl)
static int numusehash(const Table *t, unsigned int *nums, unsigned int *pna)
int luaS_eqlngstr(TString *a, TString *b)
void luaH_finishset(lua_State *L, Table *t, const TValue *key, const TValue *slot, TValue *value)
#define keyisshrstr(node)
static int ispow2realasize(const Table *t)
static unsigned int computesizes(unsigned int nums[], unsigned int *pna)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45