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.
This commit is contained in:
Roberto Ierusalimschy
2014-07-17 14:09:50 -03:00
parent 1aa4f69b51
commit 5a9cc57a5e
2 changed files with 30 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lobject.h,v 2.93 2014/05/29 19:30:07 roberto Exp roberto $
** $Id: lobject.h,v 2.94 2014/06/19 18:39:36 roberto Exp roberto $
** Type definitions for Lua objects
** See Copyright Notice in lua.h
*/
@@ -69,9 +69,9 @@
/*
** Union of all collectable objects
** Common type for all collectable objects
*/
typedef union GCObject GCObject;
typedef struct GCObject GCObject;
/*
@@ -82,11 +82,13 @@ typedef union GCObject GCObject;
/*
** Common header in struct form
** Common type has only the common header
*/
typedef struct GCheader {
CommonHeader;
} GCheader;
struct GCObject {
struct {
CommonHeader;
} gch;
};