aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ltable.c b/ltable.c
index 6279d936..4e0eb59f 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 1.1 1997/08/14 20:19:10 roberto Exp roberto $ 2** $Id: ltable.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -23,7 +23,7 @@
23#define TagDefault LUA_T_ARRAY; 23#define TagDefault LUA_T_ARRAY;
24 24
25 25
26Hash *luaH_root = NULL; 26GCnode luaH_root = {NULL, 0};
27 27
28 28
29 29
@@ -103,14 +103,6 @@ void luaH_free (Hash *frees)
103} 103}
104 104
105 105
106static void inserttable (Hash *table)
107{
108 ++luaO_nentities;
109 table->head.next = (GCnode *)luaH_root;
110 luaH_root = table;
111 table->head.marked = 0;
112}
113
114Hash *luaH_new (int nhash) 106Hash *luaH_new (int nhash)
115{ 107{
116 Hash *t = luaM_new(Hash); 108 Hash *t = luaM_new(Hash);
@@ -119,7 +111,7 @@ Hash *luaH_new (int nhash)
119 nhash(t) = nhash; 111 nhash(t) = nhash;
120 nuse(t) = 0; 112 nuse(t) = 0;
121 t->htag = TagDefault; 113 t->htag = TagDefault;
122 inserttable(t); 114 luaO_insertlist(&luaH_root, (GCnode *)t);
123 return t; 115 return t;
124} 116}
125 117