RetroArch
Classes | 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:

Classes

struct  AuxsetnodeT
 

Macros

#define ltable_c
 
#define LUA_CORE
 
#define MAXABITS   cast_int(sizeof(int) * CHAR_BIT - 1)
 
#define MAXASIZE   (1u << MAXABITS)
 
#define MAXHBITS   (MAXABITS - 1)
 
#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_)
 

Functions

static int l_hashfloat (lua_Number n)
 
static Nodemainposition (const Table *t, const TValue *key)
 
static unsigned int arrayindex (const TValue *key)
 
static unsigned int findindex (lua_State *L, Table *t, StkId key)
 
int luaH_next (lua_State *L, Table *t, StkId key)
 
static unsigned int computesizes (unsigned int nums[], unsigned int *pna)
 
static int countint (const TValue *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 setarrayvector (lua_State *L, Table *t, unsigned int size)
 
static void setnodevector (lua_State *L, Table *t, unsigned int size)
 
static void auxsetnode (lua_State *L, void *ud)
 
void luaH_resize (lua_State *L, Table *t, unsigned int nasize, 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)
 
TValueluaH_newkey (lua_State *L, Table *t, const TValue *key)
 
const TValueluaH_getint (Table *t, lua_Integer key)
 
const TValueluaH_getshortstr (Table *t, TString *key)
 
static const TValuegetgeneric (Table *t, const TValue *key)
 
const TValueluaH_getstr (Table *t, TString *key)
 
const TValueluaH_get (Table *t, const TValue *key)
 
TValueluaH_set (lua_State *L, Table *t, const TValue *key)
 
void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value)
 
static lua_Unsigned unbound_search (Table *t, lua_Unsigned j)
 
lua_Unsigned luaH_getn (Table *t)
 

Variables

static const Node dummynode_
 

Macro Definition Documentation

◆ dummynode

#define dummynode   (&dummynode_)

◆ hashboolean

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

◆ hashint

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

◆ hashmod

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

◆ hashpointer

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

◆ hashpow2

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

◆ hashstr

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

◆ ltable_c

#define ltable_c

◆ LUA_CORE

#define LUA_CORE

◆ MAXABITS

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

◆ MAXASIZE

#define MAXASIZE   (1u << MAXABITS)

◆ MAXHBITS

#define MAXHBITS   (MAXABITS - 1)

Function Documentation

◆ arrayindex()

static unsigned int arrayindex ( const TValue key)
static
Here is the caller graph for this function:

◆ auxsetnode()

static void auxsetnode ( lua_State L,
void ud 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computesizes()

static unsigned int computesizes ( unsigned int  nums[],
unsigned int *  pna 
)
static
Here is the caller graph for this function:

◆ countint()

static int countint ( const TValue key,
unsigned int *  nums 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findindex()

static unsigned int findindex ( lua_State L,
Table t,
StkId  key 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getfreepos()

static Node* getfreepos ( Table t)
static
Here is the caller graph for this function:

◆ getgeneric()

static const TValue* getgeneric ( Table t,
const TValue key 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ l_hashfloat()

static int l_hashfloat ( lua_Number  n)
static
Here is the caller graph for this function:

◆ luaH_free()

void luaH_free ( lua_State L,
Table t 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_get()

const TValue* luaH_get ( Table t,
const TValue key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_getint()

const TValue* luaH_getint ( Table t,
lua_Integer  key 
)
Here is the caller graph for this function:

◆ luaH_getn()

lua_Unsigned luaH_getn ( Table t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_getshortstr()

const TValue* luaH_getshortstr ( Table t,
TString key 
)
Here is the caller graph for this function:

◆ luaH_getstr()

const TValue* luaH_getstr ( Table t,
TString key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_new()

Table* luaH_new ( lua_State L)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_newkey()

TValue* luaH_newkey ( lua_State L,
Table t,
const TValue key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_next()

int luaH_next ( lua_State L,
Table t,
StkId  key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_resize()

void luaH_resize ( lua_State L,
Table t,
unsigned int  nasize,
unsigned int  nhsize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_resizearray()

void luaH_resizearray ( lua_State L,
Table t,
unsigned int  nasize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_set()

TValue* luaH_set ( lua_State L,
Table t,
const TValue key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaH_setint()

void luaH_setint ( lua_State L,
Table t,
lua_Integer  key,
TValue value 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mainposition()

static Node* mainposition ( const Table t,
const TValue key 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ numusearray()

static unsigned int numusearray ( const Table t,
unsigned int *  nums 
)
static
Here is the caller graph for this function:

◆ numusehash()

static int numusehash ( const Table t,
unsigned int *  nums,
unsigned int *  pna 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rehash()

static void rehash ( lua_State L,
Table t,
const TValue ek 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setarrayvector()

static void setarrayvector ( lua_State L,
Table t,
unsigned int  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setnodevector()

static void setnodevector ( lua_State L,
Table t,
unsigned int  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unbound_search()

static lua_Unsigned unbound_search ( Table t,
lua_Unsigned  j 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dummynode_

const Node dummynode_
static
Initial value:
= {
{{NILCONSTANT, 0}}
}
#define NILCONSTANT
Definition: lobject.h:120