Github User Fetcher 1.0.0
C Application with Server and GUI
|
#include "lprefix.h"
#include <math.h>
#include <limits.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "lvm.h"
Go to the source code of this file.
Macros | |
#define | ltable_c |
#define | LUA_CORE |
#define | MAXABITS cast_int(sizeof(int) * CHAR_BIT - 1) |
#define | MAXASIZE luaM_limitN(1u << MAXABITS, TValue) |
#define | MAXHBITS (MAXABITS - 1) |
#define | MAXHSIZE luaM_limitN(1u << MAXHBITS, Node) |
#define | hashpow2(t, n) (gnode(t, lmod((n), sizenode(t)))) |
#define | hashmod(t, n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) |
#define | hashstr(t, str) hashpow2(t, (str)->hash) |
#define | hashboolean(t, p) hashpow2(t, p) |
#define | hashint(t, i) hashpow2(t, i) |
#define | hashpointer(t, p) hashmod(t, point2uint(p)) |
#define | dummynode (&dummynode_) |
#define | limitequalsasize(t) (isrealasize(t) || ispow2((t)->alimit)) |
#define | limitasasize(t) check_exp(isrealasize(t), t->alimit) |
Functions | |
static int | l_hashfloat (lua_Number n) |
static Node * | mainposition (const Table *t, int ktt, const Value *kvl) |
static Node * | mainpositionTV (const Table *t, const TValue *key) |
static int | equalkey (const TValue *k1, const Node *n2, int deadok) |
LUAI_FUNC unsigned int | luaH_realasize (const Table *t) |
static int | ispow2realasize (const Table *t) |
static unsigned int | setlimittosize (Table *t) |
static const TValue * | getgeneric (Table *t, const TValue *key, int deadok) |
static unsigned int | arrayindex (lua_Integer k) |
static unsigned int | findindex (lua_State *L, Table *t, TValue *key, unsigned int asize) |
int | luaH_next (lua_State *L, Table *t, StkId key) |
static void | freehash (lua_State *L, Table *t) |
static unsigned int | computesizes (unsigned int nums[], unsigned int *pna) |
static int | countint (lua_Integer key, unsigned int *nums) |
static unsigned int | numusearray (const Table *t, unsigned int *nums) |
static int | numusehash (const Table *t, unsigned int *nums, unsigned int *pna) |
static void | setnodevector (lua_State *L, Table *t, unsigned int size) |
static void | reinsert (lua_State *L, Table *ot, Table *t) |
static void | exchangehashpart (Table *t1, Table *t2) |
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) |
static void | rehash (lua_State *L, Table *t, const TValue *ek) |
Table * | luaH_new (lua_State *L) |
void | luaH_free (lua_State *L, Table *t) |
static Node * | getfreepos (Table *t) |
void | luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) |
const TValue * | luaH_getint (Table *t, lua_Integer key) |
const TValue * | luaH_getshortstr (Table *t, TString *key) |
const TValue * | luaH_getstr (Table *t, TString *key) |
const TValue * | luaH_get (Table *t, const TValue *key) |
void | luaH_finishset (lua_State *L, Table *t, const TValue *key, const TValue *slot, TValue *value) |
void | luaH_set (lua_State *L, Table *t, const TValue *key, TValue *value) |
void | luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value) |
static lua_Unsigned | hash_search (Table *t, lua_Unsigned j) |
static unsigned int | binsearch (const TValue *array, unsigned int i, unsigned int j) |
lua_Unsigned | luaH_getn (Table *t) |
Variables | |
static const Node | dummynode_ |
static const TValue | absentkey = {ABSTKEYCONSTANT} |
#define dummynode (&dummynode_) |
Definition at line 93 of file lua-5.4.3/src/ltable.c.
Referenced by setnodevector().
#define hashboolean | ( | t, | |
p ) hashpow2(t, p) |
Definition at line 85 of file lua-5.4.3/src/ltable.c.
Referenced by mainposition().
#define hashint | ( | t, | |
i ) hashpow2(t, i) |
Definition at line 87 of file lua-5.4.3/src/ltable.c.
Referenced by luaH_getint(), and mainposition().
Definition at line 81 of file lua-5.4.3/src/ltable.c.
Referenced by mainposition().
#define hashpointer | ( | t, | |
p ) hashmod(t, point2uint(p)) |
Definition at line 90 of file lua-5.4.3/src/ltable.c.
Referenced by mainposition().
Definition at line 75 of file lua-5.4.3/src/ltable.c.
Referenced by mainposition().
#define hashstr | ( | t, | |
str ) hashpow2(t, (str)->hash) |
Definition at line 84 of file lua-5.4.3/src/ltable.c.
Referenced by luaH_getshortstr(), and mainposition().
#define limitasasize | ( | t | ) | check_exp(isrealasize(t), t->alimit) |
Definition at line 279 of file lua-5.4.3/src/ltable.c.
Referenced by numusearray().
#define limitequalsasize | ( | t | ) | (isrealasize(t) || ispow2((t)->alimit)) |
Definition at line 235 of file lua-5.4.3/src/ltable.c.
Referenced by luaH_getint(), luaH_getn(), and luaH_realasize().
#define ltable_c |
Definition at line 7 of file lua-5.4.3/src/ltable.c.
#define LUA_CORE |
Definition at line 8 of file lua-5.4.3/src/ltable.c.
#define MAXABITS cast_int(sizeof(int) * CHAR_BIT - 1) |
Definition at line 46 of file lua-5.4.3/src/ltable.c.
Referenced by numusearray(), and rehash().
#define MAXASIZE luaM_limitN(1u << MAXABITS, TValue) |
Definition at line 54 of file lua-5.4.3/src/ltable.c.
Referenced by arrayindex().
#define MAXHBITS (MAXABITS - 1) |
Definition at line 60 of file lua-5.4.3/src/ltable.c.
Referenced by setnodevector().
#define MAXHSIZE luaM_limitN(1u << MAXHBITS, Node) |
Definition at line 68 of file lua-5.4.3/src/ltable.c.
Referenced by setnodevector().
|
static |
Definition at line 307 of file lua-5.4.3/src/ltable.c.
References cast_uint, l_castS2U, and MAXASIZE.
Referenced by countint(), and findindex().
|
static |
Definition at line 869 of file lua-5.4.3/src/ltable.c.
References isempty.
Referenced by luaH_getn().
|
static |
Definition at line 380 of file lua-5.4.3/src/ltable.c.
References lua_assert.
Referenced by rehash().
|
static |
Definition at line 402 of file lua-5.4.3/src/ltable.c.
References arrayindex(), and luaO_ceillog2().
Referenced by numusehash(), and rehash().
Definition at line 207 of file lua-5.4.3/src/ltable.c.
References ctb, fltvalue, fltvalueraw, fvalue, fvalueraw, gcvalue, gcvalueraw, iscollectable, ivalue, keyisdead, keyival, keystrval, keytt, keyval, LUA_VFALSE, LUA_VLCF, LUA_VLIGHTUSERDATA, LUA_VLNGSTR, LUA_VNIL, LUA_VNUMFLT, LUA_VNUMINT, LUA_VTRUE, luai_numeq, luaS_eqlngstr(), pvalue, pvalueraw, rawtt, and tsvalue.
Referenced by getgeneric().
Definition at line 516 of file lua-5.4.3/src/ltable.c.
References Table::lastfree, Table::lsizenode, and Table::node.
Referenced by luaH_resize().
Definition at line 320 of file lua-5.4.3/src/ltable.c.
References arrayindex(), cast_int, getgeneric(), gnode, isabstkey, ivalue, luaG_runerror(), nodefromval, ttisinteger, and ttisnil.
Referenced by luaH_next().
Definition at line 360 of file lua-5.4.3/src/ltable.c.
References cast_sizet, isdummy, luaM_freearray, Table::node, and sizenode.
Referenced by luaH_free(), and luaH_resize().
Definition at line 634 of file lua-5.4.3/src/ltable.c.
References isdummy, keyisnil, Table::lastfree, Table::node, and NULL.
Referenced by luaH_newkey().
Definition at line 288 of file lua-5.4.3/src/ltable.c.
References absentkey, equalkey(), gnext, gval, and mainpositionTV().
Referenced by findindex(), luaH_get(), and luaH_getstr().
|
static |
Definition at line 844 of file lua-5.4.3/src/ltable.c.
References isempty, l_castS2U, and luaH_getint().
Referenced by luaH_getn().
|
static |
Definition at line 267 of file lua-5.4.3/src/ltable.c.
References Table::alimit, ispow2, and isrealasize.
Referenced by luaH_getn().
|
static |
Definition at line 119 of file lua-5.4.3/src/ltable.c.
References cast_int, cast_num, cast_uint, l_mathop, lua_assert, lua_numbertointeger, and luai_numisnan.
Referenced by mainposition().
void luaH_finishset | ( | lua_State * | L, |
Table * | t, | ||
const TValue * | key, | ||
const TValue * | slot, | ||
TValue * | value ) |
Definition at line 800 of file lua-5.4.3/src/ltable.c.
References cast, isabstkey, luaH_newkey(), setobj2t, and value.
Referenced by addk(), luaH_set(), luaV_finishset(), and luaX_newstring().
Definition at line 627 of file lua-5.4.3/src/ltable.c.
References Table::array, freehash(), luaH_realasize(), luaM_free, and luaM_freearray.
Definition at line 777 of file lua-5.4.3/src/ltable.c.
References absentkey, F2Ieq, fltvalue, getgeneric(), ivalue, LUA_VNIL, LUA_VNUMFLT, LUA_VNUMINT, LUA_VSHRSTR, luaH_getint(), luaH_getshortstr(), luaV_flttointeger(), tsvalue, and ttypetag.
Referenced by luaH_set().
const TValue * luaH_getint | ( | Table * | t, |
lua_Integer | key ) |
Definition at line 719 of file lua-5.4.3/src/ltable.c.
References absentkey, Table::alimit, Table::array, cast_uint, gnext, gval, hashint, keyisinteger, keyival, l_castS2U, limitequalsasize, and luaH_realasize().
Referenced by hash_search(), luaH_get(), luaH_getn(), and luaH_setint().
lua_Unsigned luaH_getn | ( | Table * | t | ) |
Definition at line 912 of file lua-5.4.3/src/ltable.c.
References Table::alimit, Table::array, binsearch(), cast, hash_search(), isdummy, isempty, ispow2, ispow2realasize(), limitequalsasize, lua_assert, luaH_getint(), luaH_realasize(), and setnorealasize.
Definition at line 747 of file lua-5.4.3/src/ltable.c.
References absentkey, eqshrstr, gnext, gval, hashstr, keyisshrstr, keystrval, lua_assert, and LUA_VSHRSTR.
Referenced by luaH_get(), and luaH_getstr().
Definition at line 763 of file lua-5.4.3/src/ltable.c.
References cast, getgeneric(), LUA_VSHRSTR, luaH_getshortstr(), NULL, and setsvalue.
Definition at line 615 of file lua-5.4.3/src/ltable.c.
References Table::alimit, Table::array, cast_byte, Table::flags, gco2t, LUA_VTABLE, luaC_newobj(), maskflags, Table::metatable, NULL, and setnodevector().
Definition at line 654 of file lua-5.4.3/src/ltable.c.
References cast_int, F2Ieq, fltvalue, getfreepos(), gnext, gval, isdummy, isempty, keytt, keyval, lua_assert, luaC_barrierback, luaG_runerror(), luaH_set(), luai_numisnan, luaV_flttointeger(), mainposition(), mainpositionTV(), NULL, obj2gco, rehash(), setempty, setivalue, setnodekey, setobj2t, ttisfloat, ttisnil, and value.
Referenced by luaH_finishset(), and luaH_setint().
Definition at line 338 of file lua-5.4.3/src/ltable.c.
References Table::array, cast_int, findindex(), getnodekey, gnode, gval, isempty, luaH_realasize(), s2v, setivalue, setobj2s, and sizenode.
Definition at line 241 of file lua-5.4.3/src/ltable.c.
References Table::alimit, ispow2, limitequalsasize, and lua_assert.
Referenced by clearbyvalues(), luaH_free(), luaH_getint(), luaH_getn(), luaH_next(), luaV_execute(), setlimittosize(), traverseephemeron(), and traversestrongtable().
Definition at line 542 of file lua-5.4.3/src/ltable.c.
References Table::alimit, Table::array, exchangehashpart(), freehash(), isempty, luaH_setint(), luaM_error, luaM_reallocvector, NULL, reinsert(), setempty, setlimittosize(), and setnodevector().
Referenced by luaH_resizearray(), and rehash().
Definition at line 579 of file lua-5.4.3/src/ltable.c.
References allocsizenode, and luaH_resize().
Definition at line 813 of file lua-5.4.3/src/ltable.c.
References luaH_finishset(), luaH_get(), and value.
Referenced by luaH_newkey(), and reinsert().
void luaH_setint | ( | lua_State * | L, |
Table * | t, | ||
lua_Integer | key, | ||
TValue * | value ) |
Definition at line 819 of file lua-5.4.3/src/ltable.c.
References cast, isabstkey, luaH_getint(), luaH_newkey(), setivalue, setobj2t, and value.
Referenced by luaH_resize().
Definition at line 141 of file lua-5.4.3/src/ltable.c.
References fltvalueraw, fvalueraw, gcvalueraw, hashboolean, hashint, hashmod, hashpointer, hashpow2, hashstr, ivalueraw, l_hashfloat(), LUA_VFALSE, LUA_VLCF, LUA_VLIGHTUSERDATA, LUA_VLNGSTR, LUA_VNUMFLT, LUA_VNUMINT, LUA_VSHRSTR, LUA_VTRUE, luaS_hashlongstr(), pvalueraw, tsvalueraw, and withvariant.
Referenced by luaH_newkey(), and mainpositionTV().
Definition at line 182 of file lua-5.4.3/src/ltable.c.
References mainposition(), rawtt, and valraw.
Referenced by getgeneric(), and luaH_newkey().
|
static |
Definition at line 418 of file lua-5.4.3/src/ltable.c.
References Table::array, isempty, limitasasize, and MAXABITS.
Referenced by rehash().
|
static |
Definition at line 445 of file lua-5.4.3/src/ltable.c.
References countint(), gval, isempty, keyisinteger, keyival, Table::node, and sizenode.
Referenced by rehash().
Definition at line 587 of file lua-5.4.3/src/ltable.c.
References computesizes(), countint(), ivalue, luaH_resize(), MAXABITS, numusearray(), numusehash(), setlimittosize(), and ttisinteger.
Referenced by luaH_newkey().
Definition at line 497 of file lua-5.4.3/src/ltable.c.
References getnodekey, gnode, gval, isempty, luaH_set(), and sizenode.
Referenced by luaH_resize().
|
static |
Definition at line 272 of file lua-5.4.3/src/ltable.c.
References Table::alimit, luaH_realasize(), and setrealasize.
Referenced by luaH_resize(), and rehash().
Definition at line 469 of file lua-5.4.3/src/ltable.c.
References cast, cast_byte, dummynode, gnext, gnode, gval, Table::lastfree, Table::lsizenode, luaG_runerror(), luaM_newvector, luaO_ceillog2(), MAXHBITS, MAXHSIZE, Table::node, NULL, setempty, setnilkey, and twoto.
Referenced by luaH_new(), and luaH_resize().
|
static |
Definition at line 101 of file lua-5.4.3/src/ltable.c.
Referenced by getgeneric(), luaH_get(), luaH_getint(), and luaH_getshortstr().
|
static |
Definition at line 95 of file lua-5.4.3/src/ltable.c.