Macros | Functions | Variables
ltable.c File Reference
#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"
Include dependency graph for ltable.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define dummynode   (&dummynode_)
 
#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 hashpow2(t, n)   (gnode(t, lmod((n), sizenode(t))))
 
#define hashstr(t, str)   hashpow2(t, (str)->hash)
 
#define limitasasize(t)   check_exp(isrealasize(t), t->alimit)
 
#define limitequalsasize(t)   (isrealasize(t) || ispow2((t)->alimit))
 
#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)
 

Functions

static unsigned int arrayindex (lua_Integer k)
 
static unsigned int binsearch (const TValue *array, unsigned int i, unsigned int j)
 
static unsigned int computesizes (unsigned int nums[], unsigned int *pna)
 
static int countint (lua_Integer key, unsigned int *nums)
 
static int equalkey (const TValue *k1, const Node *n2)
 
static void exchangehashpart (Table *t1, Table *t2)
 
static unsigned int findindex (lua_State *L, Table *t, TValue *key, unsigned int asize)
 
static void freehash (lua_State *L, Table *t)
 
static Nodegetfreepos (Table *t)
 
static const TValuegetgeneric (Table *t, const TValue *key)
 
static lua_Unsigned hash_search (Table *t, lua_Unsigned j)
 
static int ispow2realasize (const Table *t)
 
static int l_hashfloat (lua_Number n)
 
void luaH_free (lua_State *L, Table *t)
 
const TValueluaH_get (Table *t, const TValue *key)
 
const TValueluaH_getint (Table *t, lua_Integer key)
 
lua_Unsigned luaH_getn (Table *t)
 
const TValueluaH_getshortstr (Table *t, TString *key)
 
const TValueluaH_getstr (Table *t, TString *key)
 
TableluaH_new (lua_State *L)
 
TValueluaH_newkey (lua_State *L, Table *t, const TValue *key)
 
int luaH_next (lua_State *L, Table *t, StkId key)
 
LUAI_FUNC unsigned int luaH_realasize (const Table *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)
 
TValueluaH_set (lua_State *L, Table *t, const TValue *key)
 
void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value)
 
static Nodemainposition (const Table *t, int ktt, const Value *kvl)
 
static NodemainpositionTV (const Table *t, const TValue *key)
 
static unsigned int numusearray (const Table *t, unsigned int *nums)
 
static int numusehash (const Table *t, unsigned int *nums, unsigned int *pna)
 
static void rehash (lua_State *L, Table *t, const TValue *ek)
 
static void reinsert (lua_State *L, Table *ot, Table *t)
 
static unsigned int setlimittosize (Table *t)
 
static void setnodevector (lua_State *L, Table *t, unsigned int size)
 

Variables

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

Macro Definition Documentation

#define dummynode   (&dummynode_)

Definition at line 88 of file ltable.c.

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

Definition at line 74 of file ltable.c.

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

Definition at line 75 of file ltable.c.

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

Definition at line 82 of file ltable.c.

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

Definition at line 85 of file ltable.c.

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

Definition at line 71 of file ltable.c.

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

Definition at line 73 of file ltable.c.

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

Definition at line 247 of file ltable.c.

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

Definition at line 203 of file ltable.c.

#define ltable_c

Definition at line 7 of file ltable.c.

#define LUA_CORE

Definition at line 8 of file ltable.c.

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

Definition at line 46 of file ltable.c.

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

Definition at line 54 of file ltable.c.

#define MAXHBITS   (MAXABITS - 1)

Definition at line 60 of file ltable.c.

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

Definition at line 68 of file ltable.c.

Function Documentation

static unsigned int arrayindex ( lua_Integer  k)
static

Definition at line 274 of file ltable.c.

static unsigned int binsearch ( const TValue array,
unsigned int  i,
unsigned int  j 
)
static

Definition at line 822 of file ltable.c.

static unsigned int computesizes ( unsigned int  nums[],
unsigned int *  pna 
)
static

Definition at line 347 of file ltable.c.

static int countint ( lua_Integer  key,
unsigned int *  nums 
)
static

Definition at line 369 of file ltable.c.

static int equalkey ( const TValue k1,
const Node n2 
)
static

Definition at line 176 of file ltable.c.

static void exchangehashpart ( Table t1,
Table t2 
)
static

Definition at line 483 of file ltable.c.

static unsigned int findindex ( lua_State L,
Table t,
TValue key,
unsigned int  asize 
)
static

Definition at line 287 of file ltable.c.

static void freehash ( lua_State L,
Table t 
)
static

Definition at line 327 of file ltable.c.

static Node* getfreepos ( Table t)
static

Definition at line 601 of file ltable.c.

static const TValue* getgeneric ( Table t,
const TValue key 
)
static

Definition at line 255 of file ltable.c.

static lua_Unsigned hash_search ( Table t,
lua_Unsigned  j 
)
static

Definition at line 797 of file ltable.c.

static int ispow2realasize ( const Table t)
static

Definition at line 235 of file ltable.c.

static int l_hashfloat ( lua_Number  n)
static

Definition at line 114 of file ltable.c.

void luaH_free ( lua_State L,
Table t 
)

Definition at line 594 of file ltable.c.

const TValue* luaH_get ( Table t,
const TValue key 
)

Definition at line 741 of file ltable.c.

const TValue* luaH_getint ( Table t,
lua_Integer  key 
)

Definition at line 683 of file ltable.c.

lua_Unsigned luaH_getn ( Table t)

Definition at line 865 of file ltable.c.

const TValue* luaH_getshortstr ( Table t,
TString key 
)

Definition at line 711 of file ltable.c.

const TValue* luaH_getstr ( Table t,
TString key 
)

Definition at line 727 of file ltable.c.

Table* luaH_new ( lua_State L)

Definition at line 582 of file ltable.c.

TValue* luaH_newkey ( lua_State L,
Table t,
const TValue key 
)

Definition at line 621 of file ltable.c.

int luaH_next ( lua_State L,
Table t,
StkId  key 
)

Definition at line 305 of file ltable.c.

LUAI_FUNC unsigned int luaH_realasize ( const Table t)

Definition at line 209 of file ltable.c.

void luaH_resize ( lua_State L,
Table t,
unsigned int  newasize,
unsigned int  nhsize 
)

Definition at line 509 of file ltable.c.

void luaH_resizearray ( lua_State L,
Table t,
unsigned int  nasize 
)

Definition at line 546 of file ltable.c.

TValue* luaH_set ( lua_State L,
Table t,
const TValue key 
)

Definition at line 762 of file ltable.c.

void luaH_setint ( lua_State L,
Table t,
lua_Integer  key,
TValue value 
)

Definition at line 770 of file ltable.c.

static Node* mainposition ( const Table t,
int  ktt,
const Value kvl 
)
static

Definition at line 136 of file ltable.c.

static Node* mainpositionTV ( const Table t,
const TValue key 
)
static

Definition at line 163 of file ltable.c.

static unsigned int numusearray ( const Table t,
unsigned int *  nums 
)
static

Definition at line 385 of file ltable.c.

static int numusehash ( const Table t,
unsigned int *  nums,
unsigned int *  pna 
)
static

Definition at line 412 of file ltable.c.

static void rehash ( lua_State L,
Table t,
const TValue ek 
)
static

Definition at line 554 of file ltable.c.

static void reinsert ( lua_State L,
Table ot,
Table t 
)
static

Definition at line 464 of file ltable.c.

static unsigned int setlimittosize ( Table t)
static

Definition at line 240 of file ltable.c.

static void setnodevector ( lua_State L,
Table t,
unsigned int  size 
)
static

Definition at line 436 of file ltable.c.

Variable Documentation

const TValue absentkey = {ABSTKEYCONSTANT}
static

Definition at line 96 of file ltable.c.

const Node dummynode_
static
Initial value:
= {
{{NULL}, LUA_VEMPTY,
LUA_VNIL, 0, {NULL}}
}
#define LUA_VEMPTY
Definition: lobject.h:162
#define LUA_VNIL
Definition: lobject.h:159

Definition at line 90 of file ltable.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:48