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:

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, int deadok)
 
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, int deadok)
 
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_finishset (lua_State *L, Table *t, const TValue *key, const TValue *slot, TValue *value)
 
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)
 
void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value)
 
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)
 
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 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

◆ dummynode

#define dummynode   (&dummynode_)

Definition at line 93 of file ltable.c.

◆ hashboolean

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

Definition at line 85 of file ltable.c.

◆ hashint

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

Definition at line 87 of file ltable.c.

◆ hashmod

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

Definition at line 81 of file ltable.c.

◆ hashpointer

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

Definition at line 90 of file ltable.c.

◆ hashpow2

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

Definition at line 75 of file ltable.c.

◆ hashstr

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

Definition at line 84 of file ltable.c.

◆ limitasasize

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

Definition at line 279 of file ltable.c.

◆ limitequalsasize

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

Definition at line 235 of file ltable.c.

◆ ltable_c

#define ltable_c

Definition at line 7 of file ltable.c.

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file ltable.c.

◆ MAXABITS

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

Definition at line 46 of file ltable.c.

◆ MAXASIZE

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

Definition at line 54 of file ltable.c.

◆ MAXHBITS

#define MAXHBITS   (MAXABITS - 1)

Definition at line 60 of file ltable.c.

◆ MAXHSIZE

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

Definition at line 68 of file ltable.c.

Function Documentation

◆ arrayindex()

static unsigned int arrayindex ( lua_Integer  k)
static

Definition at line 307 of file ltable.c.

◆ binsearch()

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

Definition at line 869 of file ltable.c.

◆ computesizes()

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

Definition at line 380 of file ltable.c.

◆ countint()

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

Definition at line 402 of file ltable.c.

◆ equalkey()

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

Definition at line 207 of file ltable.c.

◆ exchangehashpart()

static void exchangehashpart ( Table t1,
Table t2 
)
static

Definition at line 516 of file ltable.c.

◆ findindex()

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

Definition at line 320 of file ltable.c.

◆ freehash()

static void freehash ( lua_State L,
Table t 
)
static

Definition at line 360 of file ltable.c.

◆ getfreepos()

static Node* getfreepos ( Table t)
static

Definition at line 634 of file ltable.c.

◆ getgeneric()

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

Definition at line 288 of file ltable.c.

◆ hash_search()

static lua_Unsigned hash_search ( Table t,
lua_Unsigned  j 
)
static

Definition at line 844 of file ltable.c.

◆ ispow2realasize()

static int ispow2realasize ( const Table t)
static

Definition at line 267 of file ltable.c.

◆ l_hashfloat()

static int l_hashfloat ( lua_Number  n)
static

Definition at line 119 of file ltable.c.

◆ luaH_finishset()

void luaH_finishset ( lua_State L,
Table t,
const TValue key,
const TValue slot,
TValue value 
)

Definition at line 800 of file ltable.c.

◆ luaH_free()

void luaH_free ( lua_State L,
Table t 
)

Definition at line 627 of file ltable.c.

◆ luaH_get()

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

Definition at line 777 of file ltable.c.

◆ luaH_getint()

const TValue* luaH_getint ( Table t,
lua_Integer  key 
)

Definition at line 719 of file ltable.c.

◆ luaH_getn()

lua_Unsigned luaH_getn ( Table t)

Definition at line 912 of file ltable.c.

◆ luaH_getshortstr()

const TValue* luaH_getshortstr ( Table t,
TString key 
)

Definition at line 747 of file ltable.c.

◆ luaH_getstr()

const TValue* luaH_getstr ( Table t,
TString key 
)

Definition at line 763 of file ltable.c.

◆ luaH_new()

Table* luaH_new ( lua_State L)

Definition at line 615 of file ltable.c.

◆ luaH_newkey()

void luaH_newkey ( lua_State L,
Table t,
const TValue key,
TValue value 
)

Definition at line 654 of file ltable.c.

◆ luaH_next()

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

Definition at line 338 of file ltable.c.

◆ luaH_realasize()

LUAI_FUNC unsigned int luaH_realasize ( const Table t)

Definition at line 241 of file ltable.c.

◆ luaH_resize()

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

Definition at line 542 of file ltable.c.

◆ luaH_resizearray()

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

Definition at line 579 of file ltable.c.

◆ luaH_set()

void luaH_set ( lua_State L,
Table t,
const TValue key,
TValue value 
)

Definition at line 813 of file ltable.c.

◆ luaH_setint()

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

Definition at line 819 of file ltable.c.

◆ mainposition()

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

Definition at line 141 of file ltable.c.

◆ mainpositionTV()

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

Definition at line 182 of file ltable.c.

◆ numusearray()

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

Definition at line 418 of file ltable.c.

◆ numusehash()

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

Definition at line 445 of file ltable.c.

◆ rehash()

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

Definition at line 587 of file ltable.c.

◆ reinsert()

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

Definition at line 497 of file ltable.c.

◆ setlimittosize()

static unsigned int setlimittosize ( Table t)
static

Definition at line 272 of file ltable.c.

◆ setnodevector()

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

Definition at line 469 of file ltable.c.

Variable Documentation

◆ absentkey

const TValue absentkey = {ABSTKEYCONSTANT}
static

Definition at line 101 of file ltable.c.

◆ dummynode_

const Node dummynode_
static
Initial value:
= {
{{NULL}, LUA_VEMPTY,
LUA_VNIL, 0, {NULL}}
}

Definition at line 95 of file ltable.c.

LUA_VEMPTY
#define LUA_VEMPTY
Definition: lobject.h:173
LUA_VNIL
#define LUA_VNIL
Definition: lobject.h:170


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49