lua5.4
宏定义 | 函数 | 变量
ltable.c 文件参考
#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"
ltable.c 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

宏定义

#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 hashstr(t, str)   hashpow2(t, (str)->hash)
 
#define hashboolean(t, p)   hashpow2(t, p)
 
#define hashint(t, i)   hashpow2(t, i)
 
#define hashmod(t, n)   (gnode(t, ((n) % ((sizenode(t)-1)|1))))
 
#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)
 

函数

static int l_hashfloat (lua_Number n)
 
static Nodemainposition (const Table *t, int ktt, const Value *kvl)
 
static NodemainpositionTV (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 TValuegetgeneric (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)
 
TableluaH_new (lua_State *L)
 
void luaH_free (lua_State *L, Table *t)
 
static Nodegetfreepos (Table *t)
 
void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value)
 
const TValueluaH_getint (Table *t, lua_Integer key)
 
const TValueluaH_getshortstr (Table *t, TString *key)
 
const TValueluaH_getstr (Table *t, TString *key)
 
const TValueluaH_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)
 

变量

static const Node dummynode_
 
static const TValue absentkey = {ABSTKEYCONSTANT}
 

宏定义说明

◆ dummynode

#define dummynode   (&dummynode_)

◆ hashboolean

#define hashboolean (   t,
 
)    hashpow2(t, p)

◆ hashint

#define hashint (   t,
 
)    hashpow2(t, i)

◆ hashmod

#define hashmod (   t,
 
)    (gnode(t, ((n) % ((sizenode(t)-1)|1))))

◆ hashpointer

#define hashpointer (   t,
 
)    hashmod(t, point2uint(p))

◆ hashpow2

#define hashpow2 (   t,
 
)    (gnode(t, lmod((n), sizenode(t))))

◆ hashstr

#define hashstr (   t,
  str 
)    hashpow2(t, (str)->hash)

◆ limitasasize

#define limitasasize (   t)    check_exp(isrealasize(t), t->alimit)

◆ limitequalsasize

#define limitequalsasize (   t)    (isrealasize(t) || ispow2((t)->alimit))

◆ ltable_c

#define ltable_c

◆ LUA_CORE

#define LUA_CORE

◆ MAXABITS

#define MAXABITS   cast_int(sizeof(int) * CHAR_BIT - 1)

◆ MAXASIZE

#define MAXASIZE   luaM_limitN(1u << MAXABITS, TValue)

◆ MAXHBITS

#define MAXHBITS   (MAXABITS - 1)

◆ MAXHSIZE

#define MAXHSIZE   luaM_limitN(1u << MAXHBITS, Node)

函数说明

◆ arrayindex()

static unsigned int arrayindex ( lua_Integer  k)
static
这是这个函数的调用关系图:

◆ binsearch()

static unsigned int binsearch ( const TValue array,
unsigned int  i,
unsigned int  j 
)
static
这是这个函数的调用关系图:

◆ computesizes()

static unsigned int computesizes ( unsigned int  nums[],
unsigned int *  pna 
)
static
这是这个函数的调用关系图:

◆ countint()

static int countint ( lua_Integer  key,
unsigned int *  nums 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ equalkey()

static int equalkey ( const TValue k1,
const Node n2,
int  deadok 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ exchangehashpart()

static void exchangehashpart ( Table t1,
Table t2 
)
static
这是这个函数的调用关系图:

◆ findindex()

static unsigned int findindex ( lua_State L,
Table t,
TValue key,
unsigned int  asize 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ freehash()

static void freehash ( lua_State L,
Table t 
)
static
这是这个函数的调用关系图:

◆ getfreepos()

static Node* getfreepos ( Table t)
static
这是这个函数的调用关系图:

◆ getgeneric()

static const TValue* getgeneric ( Table t,
const TValue key,
int  deadok 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ hash_search()

static lua_Unsigned hash_search ( Table t,
lua_Unsigned  j 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ ispow2realasize()

static int ispow2realasize ( const Table t)
static
这是这个函数的调用关系图:

◆ l_hashfloat()

static int l_hashfloat ( lua_Number  n)
static
这是这个函数的调用关系图:

◆ luaH_finishset()

void luaH_finishset ( lua_State L,
Table t,
const TValue key,
const TValue slot,
TValue value 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_free()

void luaH_free ( lua_State L,
Table t 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_get()

const TValue* luaH_get ( Table t,
const TValue key 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_getint()

const TValue* luaH_getint ( Table t,
lua_Integer  key 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_getn()

lua_Unsigned luaH_getn ( Table t)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_getshortstr()

const TValue* luaH_getshortstr ( Table t,
TString key 
)
这是这个函数的调用关系图:

◆ luaH_getstr()

const TValue* luaH_getstr ( Table t,
TString key 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_new()

Table* luaH_new ( lua_State L)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_newkey()

void luaH_newkey ( lua_State L,
Table t,
const TValue key,
TValue value 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_next()

int luaH_next ( lua_State L,
Table t,
StkId  key 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_realasize()

LUAI_FUNC unsigned int luaH_realasize ( const Table t)
这是这个函数的调用关系图:

◆ luaH_resize()

void luaH_resize ( lua_State L,
Table t,
unsigned int  newasize,
unsigned int  nhsize 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_resizearray()

void luaH_resizearray ( lua_State L,
Table t,
unsigned int  nasize 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_set()

void luaH_set ( lua_State L,
Table t,
const TValue key,
TValue value 
)
函数调用图:
这是这个函数的调用关系图:

◆ luaH_setint()

void luaH_setint ( lua_State L,
Table t,
lua_Integer  key,
TValue value 
)
函数调用图:
这是这个函数的调用关系图:

◆ mainposition()

static Node* mainposition ( const Table t,
int  ktt,
const Value kvl 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ mainpositionTV()

static Node* mainpositionTV ( const Table t,
const TValue key 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ numusearray()

static unsigned int numusearray ( const Table t,
unsigned int *  nums 
)
static
这是这个函数的调用关系图:

◆ numusehash()

static int numusehash ( const Table t,
unsigned int *  nums,
unsigned int *  pna 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ rehash()

static void rehash ( lua_State L,
Table t,
const TValue ek 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ reinsert()

static void reinsert ( lua_State L,
Table ot,
Table t 
)
static
函数调用图:
这是这个函数的调用关系图:

◆ setlimittosize()

static unsigned int setlimittosize ( Table t)
static
函数调用图:
这是这个函数的调用关系图:

◆ setnodevector()

static void setnodevector ( lua_State L,
Table t,
unsigned int  size 
)
static
函数调用图:
这是这个函数的调用关系图:

变量说明

◆ absentkey

const TValue absentkey = {ABSTKEYCONSTANT}
static

◆ dummynode_

const Node dummynode_
static
初始值:
= {
{{NULL}, LUA_VEMPTY,
LUA_VNIL, 0, {NULL}}
}
LUA_VEMPTY
#define LUA_VEMPTY
Definition: lobject.h:164
LUA_VNIL
#define LUA_VNIL
Definition: lobject.h:161