summaryrefslogtreecommitdiff
path: root/tree.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-02-12 15:32:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-02-12 15:32:40 -0300
commit41259bff31dbb904edfb8070006ccb15577f8f04 (patch)
tree664bf9cbe6394e9074435ecf2bd710712b4537c3 /tree.h
parentafaa98a666acd5f596b50f56bb288815838c096e (diff)
downloadlua-41259bff31dbb904edfb8070006ccb15577f8f04.tar.gz
lua-41259bff31dbb904edfb8070006ccb15577f8f04.tar.bz2
lua-41259bff31dbb904edfb8070006ccb15577f8f04.zip
BIG CHANGE: new data structure for constants, strings and globals, using
an array of hash tables for all them.
Diffstat (limited to 'tree.h')
-rw-r--r--tree.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/tree.h b/tree.h
index bf6eb27d..eb347ed4 100644
--- a/tree.h
+++ b/tree.h
@@ -1,7 +1,7 @@
1/* 1/*
2** tree.h 2** tree.h
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4** $Id: tree.h,v 1.10 1995/10/17 11:53:53 roberto Exp roberto $ 4** $Id: tree.h,v 1.11 1996/01/26 18:03:19 roberto Exp roberto $
5*/ 5*/
6 6
7#ifndef tree_h 7#ifndef tree_h
@@ -14,23 +14,16 @@
14 14
15typedef struct TaggedString 15typedef struct TaggedString
16{ 16{
17 unsigned short varindex; /* != NOT_USED if this is a symbol */
18 unsigned short constindex; /* != NOT_USED if this is a constant */
17 unsigned long hash; /* 0 if not initialized */ 19 unsigned long hash; /* 0 if not initialized */
18 char marked; /* for garbage collection */ 20 char marked; /* for garbage collection; 2 means "never collect" */
19 char str[1]; /* \0 byte already reserved */ 21 char str[1]; /* \0 byte already reserved */
20} TaggedString; 22} TaggedString;
21 23
22typedef struct TreeNode
23{
24 struct TreeNode *right;
25 struct TreeNode *left;
26 unsigned short varindex; /* != NOT_USED if this is a symbol */
27 unsigned short constindex; /* != NOT_USED if this is a constant */
28 TaggedString ts;
29} TreeNode;
30
31 24
32TaggedString *lua_createstring (char *str); 25TaggedString *lua_createstring (char *str);
33TreeNode *lua_constcreate (char *str); 26TaggedString *luaI_createfixedstring (char *str);
34Long lua_strcollector (void); 27Long lua_strcollector (void);
35 28
36#endif 29#endif