mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-15 23:21:46 +00:00
Give all types a symbol table, not just structs and derivatives
This commit is contained in:
parent
b227a2f508
commit
82c22459dc
2 changed files with 16 additions and 6 deletions
|
@ -214,6 +214,18 @@ PType::~PType()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// PType :: PropagateMark
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
size_t PType::PropagateMark()
|
||||||
|
{
|
||||||
|
size_t marked = Symbols.MarkSymbols();
|
||||||
|
return marked + Super::PropagateMark();
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// PType :: AddConversion
|
// PType :: AddConversion
|
||||||
|
@ -1639,12 +1651,8 @@ PField *PStruct::AddField(FName name, PType *type, DWORD flags)
|
||||||
|
|
||||||
size_t PStruct::PropagateMark()
|
size_t PStruct::PropagateMark()
|
||||||
{
|
{
|
||||||
size_t marked;
|
|
||||||
|
|
||||||
GC::MarkArray(Fields);
|
GC::MarkArray(Fields);
|
||||||
marked = Fields.Size() * sizeof(void*);
|
return Fields.Size() * sizeof(void*) + Super::PropagateMark();
|
||||||
marked += Symbols.MarkSymbols();
|
|
||||||
return marked + Super::PropagateMark();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -156,6 +156,7 @@ public:
|
||||||
unsigned int Size; // this type's size
|
unsigned int Size; // this type's size
|
||||||
unsigned int Align; // this type's preferred alignment
|
unsigned int Align; // this type's preferred alignment
|
||||||
PType *HashNext; // next type in this type table
|
PType *HashNext; // next type in this type table
|
||||||
|
PSymbolTable Symbols;
|
||||||
|
|
||||||
PType();
|
PType();
|
||||||
PType(unsigned int size, unsigned int align);
|
PType(unsigned int size, unsigned int align);
|
||||||
|
@ -191,6 +192,8 @@ public:
|
||||||
// Get the type IDs used by IsMatch
|
// Get the type IDs used by IsMatch
|
||||||
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
|
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
|
||||||
|
|
||||||
|
size_t PropagateMark();
|
||||||
|
|
||||||
static void StaticInit();
|
static void StaticInit();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -530,7 +533,6 @@ public:
|
||||||
PStruct(FName name, DObject *outer);
|
PStruct(FName name, DObject *outer);
|
||||||
|
|
||||||
TArray<PField *> Fields;
|
TArray<PField *> Fields;
|
||||||
PSymbolTable Symbols;
|
|
||||||
|
|
||||||
PField *AddField(FName name, PType *type, DWORD flags=0);
|
PField *AddField(FName name, PType *type, DWORD flags=0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue