diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-17 14:09:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-17 14:09:50 -0300 |
commit | 5a9cc57a5ef75a28cd887715175a5a18db58616e (patch) | |
tree | de29400295cd5b3cc7633867488be12e5928e8b6 /lobject.h | |
parent | 1aa4f69b51a92dc4f5c9d35925b9977d35650679 (diff) | |
download | lua-5a9cc57a5ef75a28cd887715175a5a18db58616e.tar.gz lua-5a9cc57a5ef75a28cd887715175a5a18db58616e.tar.bz2 lua-5a9cc57a5ef75a28cd887715175a5a18db58616e.zip |
change in GCObject: instead of being a union, it is now a structure
with the common header of all collectable objects; union is used
only for conversions. (Goal is to be able to check that the cast
'obj2gco' can have a check to ensure that object being converted
is really a collectable object.). This is the first step in the
change.
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.93 2014/05/29 19:30:07 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.94 2014/06/19 18:39:36 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 | */ |
@@ -69,9 +69,9 @@ | |||
69 | 69 | ||
70 | 70 | ||
71 | /* | 71 | /* |
72 | ** Union of all collectable objects | 72 | ** Common type for all collectable objects |
73 | */ | 73 | */ |
74 | typedef union GCObject GCObject; | 74 | typedef struct GCObject GCObject; |
75 | 75 | ||
76 | 76 | ||
77 | /* | 77 | /* |
@@ -82,11 +82,13 @@ typedef union GCObject GCObject; | |||
82 | 82 | ||
83 | 83 | ||
84 | /* | 84 | /* |
85 | ** Common header in struct form | 85 | ** Common type has only the common header |
86 | */ | 86 | */ |
87 | typedef struct GCheader { | 87 | struct GCObject { |
88 | CommonHeader; | 88 | struct { |
89 | } GCheader; | 89 | CommonHeader; |
90 | } gch; | ||
91 | }; | ||
90 | 92 | ||
91 | 93 | ||
92 | 94 | ||