diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-02-18 10:40:02 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-02-18 10:40:02 -0200 |
| commit | 7d45a5f48ff32a4e09a1734de23823943d6a6b28 (patch) | |
| tree | de7bef1faf37d9b639928e5269e89d7112b5b6fa /lobject.h | |
| parent | 73d764024451c24bc43b8e5102fe90974a86b7f4 (diff) | |
| download | lua-7d45a5f48ff32a4e09a1734de23823943d6a6b28.tar.gz lua-7d45a5f48ff32a4e09a1734de23823943d6a6b28.tar.bz2 lua-7d45a5f48ff32a4e09a1734de23823943d6a6b28.zip | |
C functions and userdata also have environments
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.9 2005/01/05 18:20:51 roberto Exp $ | 2 | ** $Id: lobject.h,v 2.10 2005/01/18 17:18:09 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 | */ |
| @@ -218,6 +218,7 @@ typedef union Udata { | |||
| 218 | struct { | 218 | struct { |
| 219 | CommonHeader; | 219 | CommonHeader; |
| 220 | struct Table *metatable; | 220 | struct Table *metatable; |
| 221 | struct Table *env; | ||
| 221 | size_t len; | 222 | size_t len; |
| 222 | } uv; | 223 | } uv; |
| 223 | } Udata; | 224 | } Udata; |
| @@ -286,7 +287,8 @@ typedef struct UpVal { | |||
| 286 | */ | 287 | */ |
| 287 | 288 | ||
| 288 | #define ClosureHeader \ | 289 | #define ClosureHeader \ |
| 289 | CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist | 290 | CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \ |
| 291 | struct Table *env | ||
| 290 | 292 | ||
| 291 | typedef struct CClosure { | 293 | typedef struct CClosure { |
| 292 | ClosureHeader; | 294 | ClosureHeader; |
| @@ -298,7 +300,6 @@ typedef struct CClosure { | |||
| 298 | typedef struct LClosure { | 300 | typedef struct LClosure { |
| 299 | ClosureHeader; | 301 | ClosureHeader; |
| 300 | struct Proto *p; | 302 | struct Proto *p; |
| 301 | TValue g; /* global table for this closure */ | ||
| 302 | UpVal *upvals[1]; | 303 | UpVal *upvals[1]; |
| 303 | } LClosure; | 304 | } LClosure; |
| 304 | 305 | ||
