BIG CHANGE: new data structure for constants, strings and globals, using

an array of hash tables for all them.
This commit is contained in:
Roberto Ierusalimschy
1996-02-12 15:32:40 -03:00
parent afaa98a666
commit 41259bff31
12 changed files with 146 additions and 135 deletions

17
tree.h
View File

@@ -1,7 +1,7 @@
/*
** tree.h
** TecCGraf - PUC-Rio
** $Id: tree.h,v 1.10 1995/10/17 11:53:53 roberto Exp roberto $
** $Id: tree.h,v 1.11 1996/01/26 18:03:19 roberto Exp roberto $
*/
#ifndef tree_h
@@ -14,23 +14,16 @@
typedef struct TaggedString
{
unsigned short varindex; /* != NOT_USED if this is a symbol */
unsigned short constindex; /* != NOT_USED if this is a constant */
unsigned long hash; /* 0 if not initialized */
char marked; /* for garbage collection */
char marked; /* for garbage collection; 2 means "never collect" */
char str[1]; /* \0 byte already reserved */
} TaggedString;
typedef struct TreeNode
{
struct TreeNode *right;
struct TreeNode *left;
unsigned short varindex; /* != NOT_USED if this is a symbol */
unsigned short constindex; /* != NOT_USED if this is a constant */
TaggedString ts;
} TreeNode;
TaggedString *lua_createstring (char *str);
TreeNode *lua_constcreate (char *str);
TaggedString *luaI_createfixedstring (char *str);
Long lua_strcollector (void);
#endif