From 82c22459dce17ae2f688ad654401d08668d87325 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 29 Oct 2013 13:53:54 -0500 Subject: [PATCH] Give all types a symbol table, not just structs and derivatives --- src/dobjtype.cpp | 18 +++++++++++++----- src/dobjtype.h | 4 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 22e2f73c3..b025cd032 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -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(); } //========================================================================== diff --git a/src/dobjtype.h b/src/dobjtype.h index e1e5df710..402a90ffc 100644 --- a/src/dobjtype.h +++ b/src/dobjtype.h @@ -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 Fields; - PSymbolTable Symbols; PField *AddField(FName name, PType *type, DWORD flags=0);