Give all types a symbol table, not just structs and derivatives

This commit is contained in:
Randy Heit 2013-10-29 13:53:54 -05:00
parent b227a2f508
commit 82c22459dc
2 changed files with 16 additions and 6 deletions

View file

@ -214,6 +214,18 @@ PType::~PType()
{
}
//==========================================================================
//
// PType :: PropagateMark
//
//==========================================================================
size_t PType::PropagateMark()
{
size_t marked = Symbols.MarkSymbols();
return marked + Super::PropagateMark();
}
//==========================================================================
//
// PType :: AddConversion
@ -1639,12 +1651,8 @@ PField *PStruct::AddField(FName name, PType *type, DWORD flags)
size_t PStruct::PropagateMark()
{
size_t marked;
GC::MarkArray(Fields);
marked = Fields.Size() * sizeof(void*);
marked += Symbols.MarkSymbols();
return marked + Super::PropagateMark();
return Fields.Size() * sizeof(void*) + Super::PropagateMark();
}
//==========================================================================

View file

@ -156,6 +156,7 @@ public:
unsigned int Size; // this type's size
unsigned int Align; // this type's preferred alignment
PType *HashNext; // next type in this type table
PSymbolTable Symbols;
PType();
PType(unsigned int size, unsigned int align);
@ -191,6 +192,8 @@ public:
// Get the type IDs used by IsMatch
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
size_t PropagateMark();
static void StaticInit();
private:
@ -530,7 +533,6 @@ public:
PStruct(FName name, DObject *outer);
TArray<PField *> Fields;
PSymbolTable Symbols;
PField *AddField(FName name, PType *type, DWORD flags=0);