diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-13 09:49:19 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-13 09:49:19 -0200 |
commit | 3010eb05365e77065009db39d20ef9a4110479a6 (patch) | |
tree | d880230c27289095a21a7350568b114b8c743242 /lobject.h | |
parent | 2f91f95d94d3a27fee6b45c31ea9ab631924a8bf (diff) | |
download | lua-3010eb05365e77065009db39d20ef9a4110479a6.tar.gz lua-3010eb05365e77065009db39d20ef9a4110479a6.tar.bz2 lua-3010eb05365e77065009db39d20ef9a4110479a6.zip |
all objects with several children (tables, closures, stacks, prototypes)
go to `gray' queue
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.151 2002/11/04 12:31:44 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.152 2002/11/07 15:37:10 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 | */ |
@@ -219,6 +219,7 @@ typedef struct Proto { | |||
219 | int sizep; /* size of `p' */ | 219 | int sizep; /* size of `p' */ |
220 | int sizelocvars; | 220 | int sizelocvars; |
221 | int lineDefined; | 221 | int lineDefined; |
222 | GCObject *gclist; | ||
222 | lu_byte nupvalues; | 223 | lu_byte nupvalues; |
223 | lu_byte numparams; | 224 | lu_byte numparams; |
224 | lu_byte is_vararg; | 225 | lu_byte is_vararg; |
@@ -249,19 +250,18 @@ typedef struct UpVal { | |||
249 | ** Closures | 250 | ** Closures |
250 | */ | 251 | */ |
251 | 252 | ||
253 | #define ClosureHeader \ | ||
254 | CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist | ||
255 | |||
252 | typedef struct CClosure { | 256 | typedef struct CClosure { |
253 | CommonHeader; | 257 | ClosureHeader; |
254 | lu_byte isC; /* 0 for Lua functions, 1 for C functions */ | ||
255 | lu_byte nupvalues; | ||
256 | lua_CFunction f; | 258 | lua_CFunction f; |
257 | TObject upvalue[1]; | 259 | TObject upvalue[1]; |
258 | } CClosure; | 260 | } CClosure; |
259 | 261 | ||
260 | 262 | ||
261 | typedef struct LClosure { | 263 | typedef struct LClosure { |
262 | CommonHeader; | 264 | ClosureHeader; |
263 | lu_byte isC; | ||
264 | lu_byte nupvalues; /* first five fields must be equal to CClosure!! */ | ||
265 | struct Proto *p; | 265 | struct Proto *p; |
266 | TObject g; /* global table for this closure */ | 266 | TObject g; /* global table for this closure */ |
267 | UpVal *upvals[1]; | 267 | UpVal *upvals[1]; |
@@ -298,7 +298,7 @@ typedef struct Table { | |||
298 | TObject *array; /* array part */ | 298 | TObject *array; /* array part */ |
299 | Node *node; | 299 | Node *node; |
300 | Node *firstfree; /* this position is free; all positions after it are full */ | 300 | Node *firstfree; /* this position is free; all positions after it are full */ |
301 | struct Table *gclist; | 301 | GCObject *gclist; |
302 | int sizearray; /* size of `array' array */ | 302 | int sizearray; /* size of `array' array */ |
303 | } Table; | 303 | } Table; |
304 | 304 | ||