#include <math.h>
#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "ltable.h"
gehe zum Quellcode dieser Datei
|
#define | ltable_c |
|
#define | LUA_CORE |
|
#define | MAXBITS (LUAI_BITSINT-2) |
|
#define | MAXASIZE (1 << MAXBITS) |
|
#define | hashpow2(t, n) (gnode(t, lmod((n), sizenode(t)))) |
|
#define | hashstr(t, str) hashpow2(t, (str)->tsv.hash) |
|
#define | hashboolean(t, p) hashpow2(t, p) |
|
#define | hashmod(t, n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) |
|
#define | hashpointer(t, p) hashmod(t, IntPoint(p)) |
|
#define | numints cast_int(sizeof(lua_Number)/sizeof(int)) |
|
#define | dummynode (&dummynode_) |
|
|
static Node * | hashnum (const Table *t, lua_Number n) |
|
static Node * | mainposition (const Table *t, const TValue *key) |
|
static int | arrayindex (const TValue *key) |
|
static int | findindex (lua_State *L, Table *t, StkId key) |
|
LUAI_FUNC int | luaH_next (lua_State *L, Table *t, StkId key) |
|
static int | computesizes (int nums[], int *narray) |
|
static int | countint (const TValue *key, int *nums) |
|
static int | numusearray (const Table *t, int *nums) |
|
static int | numusehash (const Table *t, int *nums, int *pnasize) |
|
static void | setarrayvector (lua_State *L, Table *t, int size) |
|
static void | setnodevector (lua_State *L, Table *t, int size) |
|
static void | resize (lua_State *L, Table *t, int nasize, int nhsize) |
|
LUAI_FUNC void | luaH_resizearray (lua_State *L, Table *t, int nasize) |
|
static void | rehash (lua_State *L, Table *t, const TValue *ek) |
|
LUAI_FUNC Table * | luaH_new (lua_State *L, int narray, int nhash) |
|
LUAI_FUNC void | luaH_free (lua_State *L, Table *t) |
|
static Node * | getfreepos (Table *t) |
|
static TValue * | newkey (lua_State *L, Table *t, const TValue *key) |
|
LUAI_FUNC const TValue * | luaH_getnum (Table *t, int key) |
|
LUAI_FUNC const TValue * | luaH_getstr (Table *t, TString *key) |
|
LUAI_FUNC const TValue * | luaH_get (Table *t, const TValue *key) |
|
LUAI_FUNC TValue * | luaH_set (lua_State *L, Table *t, const TValue *key) |
|
LUAI_FUNC TValue * | luaH_setnum (lua_State *L, Table *t, int key) |
|
LUAI_FUNC TValue * | luaH_setstr (lua_State *L, Table *t, TString *key) |
|
static int | unbound_search (Table *t, unsigned int j) |
|
LUAI_FUNC int | luaH_getn (Table *t) |
|
#define hashboolean |
( |
|
t, |
|
|
|
p |
|
) |
| hashpow2(t, p) |
static int computesizes |
( |
int |
nums[], |
|
|
int * |
narray |
|
) |
| |
|
static |
Definiert in Zeile 189 der Datei ltable.c.
195 for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) {
203 if (a == *narray)
break;
Definiert in Zeile 137 der Datei ltable.c.
141 if (0 < i && i <= t->sizearray)
Definiert in Zeile 84 der Datei ltable.c.
90 for (i = 1; i <
numints; i++) a[0] += a[i];
Definiert in Zeile 560 der Datei ltable.c.
566 unsigned int m = (i+j)/2;
Definiert in Zeile 399 der Datei ltable.c.
412 while (
gnext(othern) != mp) othern =
gnext(othern);
425 gkey(mp)->value = key->value;
gkey(mp)->tt = key->tt;
static int numusearray |
( |
const Table * |
t, |
|
|
int * |
nums |
|
) |
| |
|
static |
Definiert in Zeile 222 der Datei ltable.c.
227 for (lg=0, ttlg=1; lg<=
MAXBITS; lg++, ttlg*=2) {
236 for (; i <= lim; i++) {
static int numusehash |
( |
const Table * |
t, |
|
|
int * |
nums, |
|
|
int * |
pnasize |
|
) |
| |
|
static |
Definiert in Zeile 333 der Datei ltable.c.
338 for (i=0; i<=
MAXBITS; i++) nums[i] = 0;
348 resize(L, t, nasize, totaluse - na);
static void resize |
( |
lua_State * |
L, |
|
|
Table * |
t, |
|
|
int |
nasize, |
|
|
int |
nhsize |
|
) |
| |
|
static |
Definiert in Zeile 297 der Datei ltable.c.
302 if (nasize > oldasize)
306 if (nasize < oldasize) {
309 for (i=nasize; i<oldasize; i++) {
317 for (i =
twoto(oldhsize) - 1; i >= 0; i--) {
Definiert in Zeile 272 der Datei ltable.c.
285 for (i=0; i<size; i++) {
static int unbound_search |
( |
Table * |
t, |
|
|
unsigned int |
j |
|
) |
| |
|
static |
Definiert in Zeile 532 der Datei ltable.c.
548 unsigned int m = (i+j)/2;
Initialisierung:
Definiert in Zeile 75 der Datei ltable.c.