diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-01 15:40:48 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-01 15:40:48 -0200 |
| commit | e506b864cdc522ed7bf33e81d785fcfbd40a0368 (patch) | |
| tree | c62865ee026136cd8784658110e8928127ad276c /lobject.h | |
| parent | 9a231afa9721e87ae5f9790dedcb73cd58472a3f (diff) | |
| download | lua-e506b864cdc522ed7bf33e81d785fcfbd40a0368.tar.gz lua-e506b864cdc522ed7bf33e81d785fcfbd40a0368.tar.bz2 lua-e506b864cdc522ed7bf33e81d785fcfbd40a0368.zip | |
no need for tags in boxed values :-(
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 20 |
1 files changed, 4 insertions, 16 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 1.90 2001/01/29 17:16:58 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.91 2001/01/29 19:34:02 roberto Exp roberto $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -41,13 +41,6 @@ | |||
| 41 | #define is_T_MARK(t) (ttype(t) == LUA_TMARK) | 41 | #define is_T_MARK(t) (ttype(t) == LUA_TMARK) |
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | /* | ||
| 45 | ** tag at the start of all "boxed" Lua values | ||
| 46 | */ | ||
| 47 | typedef struct TValue { | ||
| 48 | char ttype; | ||
| 49 | } TValue; | ||
| 50 | |||
| 51 | 44 | ||
| 52 | typedef union { | 45 | typedef union { |
| 53 | void *v; | 46 | void *v; |
| @@ -116,8 +109,6 @@ typedef struct lua_TObject { | |||
| 116 | #define TSPACK ((int)sizeof(int)) | 109 | #define TSPACK ((int)sizeof(int)) |
| 117 | 110 | ||
| 118 | typedef struct TString { | 111 | typedef struct TString { |
| 119 | TValue v; | ||
| 120 | unsigned char marked; | ||
| 121 | union { | 112 | union { |
| 122 | struct { /* for strings */ | 113 | struct { /* for strings */ |
| 123 | luint32 hash; | 114 | luint32 hash; |
| @@ -129,6 +120,7 @@ typedef struct TString { | |||
| 129 | } d; | 120 | } d; |
| 130 | } u; | 121 | } u; |
| 131 | size_t len; | 122 | size_t len; |
| 123 | int marked; | ||
| 132 | struct TString *nexthash; /* chain for hash table */ | 124 | struct TString *nexthash; /* chain for hash table */ |
| 133 | char str[TSPACK]; /* variable length string!! must be the last field! */ | 125 | char str[TSPACK]; /* variable length string!! must be the last field! */ |
| 134 | } TString; | 126 | } TString; |
| @@ -138,7 +130,6 @@ typedef struct TString { | |||
| 138 | ** Function Prototypes | 130 | ** Function Prototypes |
| 139 | */ | 131 | */ |
| 140 | typedef struct Proto { | 132 | typedef struct Proto { |
| 141 | TValue v; | ||
| 142 | lua_Number *knum; /* numbers used by the function */ | 133 | lua_Number *knum; /* numbers used by the function */ |
| 143 | int sizeknum; /* size of `knum' */ | 134 | int sizeknum; /* size of `knum' */ |
| 144 | struct TString **kstr; /* strings used by the function */ | 135 | struct TString **kstr; /* strings used by the function */ |
| @@ -173,15 +164,14 @@ typedef struct LocVar { | |||
| 173 | ** Closures | 164 | ** Closures |
| 174 | */ | 165 | */ |
| 175 | typedef struct Closure { | 166 | typedef struct Closure { |
| 176 | TValue v; | 167 | int isC; /* 0 for Lua functions, 1 for C functions */ |
| 177 | char isC; /* 0 for Lua functions, 1 for C functions */ | ||
| 178 | short nupvalues; | ||
| 179 | union { | 168 | union { |
| 180 | lua_CFunction c; /* C functions */ | 169 | lua_CFunction c; /* C functions */ |
| 181 | struct Proto *l; /* Lua functions */ | 170 | struct Proto *l; /* Lua functions */ |
| 182 | } f; | 171 | } f; |
| 183 | struct Closure *next; | 172 | struct Closure *next; |
| 184 | struct Closure *mark; /* marked closures (point to itself when not marked) */ | 173 | struct Closure *mark; /* marked closures (point to itself when not marked) */ |
| 174 | int nupvalues; | ||
| 185 | TObject upvalue[1]; | 175 | TObject upvalue[1]; |
| 186 | } Closure; | 176 | } Closure; |
| 187 | 177 | ||
| @@ -198,7 +188,6 @@ typedef struct Node { | |||
| 198 | 188 | ||
| 199 | 189 | ||
| 200 | typedef struct Hash { | 190 | typedef struct Hash { |
| 201 | TValue v; | ||
| 202 | Node *node; | 191 | Node *node; |
| 203 | int htag; | 192 | int htag; |
| 204 | int size; | 193 | int size; |
| @@ -223,7 +212,6 @@ typedef struct Hash { | |||
| 223 | ** informations about a call (for debugging) | 212 | ** informations about a call (for debugging) |
| 224 | */ | 213 | */ |
| 225 | typedef struct CallInfo { | 214 | typedef struct CallInfo { |
| 226 | TValue v; | ||
| 227 | struct Closure *func; /* function being called */ | 215 | struct Closure *func; /* function being called */ |
| 228 | const Instruction **pc; /* current pc of called function */ | 216 | const Instruction **pc; /* current pc of called function */ |
| 229 | int lastpc; /* last pc traced */ | 217 | int lastpc; /* last pc traced */ |
