From 41259bff31dbb904edfb8070006ccb15577f8f04 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 12 Feb 1996 15:32:40 -0300 Subject: BIG CHANGE: new data structure for constants, strings and globals, using an array of hash tables for all them. --- tree.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'tree.h') diff --git a/tree.h b/tree.h index bf6eb27d..eb347ed4 100644 --- a/tree.h +++ b/tree.h @@ -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 -- cgit v1.2.3-55-g6feb