Move the symbol table from PClass to PStruct.

This commit is contained in:
Randy Heit 2013-08-07 19:38:42 -05:00
parent 91207ed3f4
commit dbaf72772b
2 changed files with 6 additions and 20 deletions

View file

@ -864,8 +864,12 @@ IMPLEMENT_CLASS(PStruct)
size_t PStruct::PropagateMark()
{
size_t marked;
GC::MarkArray(Fields);
return Fields.Size() * sizeof(void*) + Super::PropagateMark();
marked = Fields.Size() * sizeof(void*);
marked += Symbols.MarkSymbols();
return marked + Super::PropagateMark();
}
/* PPrototype *************************************************************/
@ -1081,7 +1085,6 @@ PClass::PClass()
PClass::~PClass()
{
Symbols.ReleaseSymbols();
if (Defaults != NULL)
{
M_Free(Defaults);
@ -1431,22 +1434,6 @@ const PClass *PClass::NativeClass() const
return cls;
}
//==========================================================================
//
// PClass :: PropagateMark
//
//==========================================================================
size_t PClass::PropagateMark()
{
size_t marked;
// Mark symbols
marked = Symbols.MarkSymbols();
return marked + Super::PropagateMark();
}
/* FTypeTable **************************************************************/
//==========================================================================

View file

@ -408,6 +408,7 @@ class PStruct : public PNamedType
DECLARE_CLASS(PStruct, PNamedType);
public:
TArray<PField *> Fields;
PSymbolTable Symbols;
size_t PropagateMark();
};
@ -464,7 +465,6 @@ public:
const size_t *FlatPointers; // object pointers defined by this class and all its superclasses; not initialized by default
BYTE *Defaults;
bool bRuntimeClass; // class was defined at run-time, not compile-time
PSymbolTable Symbols;
void (*ConstructNative)(void *);
@ -478,7 +478,6 @@ public:
void InitializeActorInfo();
void BuildFlatPointers();
const PClass *NativeClass() const;
size_t PropagateMark();
// Returns true if this type is an ancestor of (or same as) the passed type.
bool IsAncestorOf(const PClass *ti) const