Add missing NewPointer() function

This commit is contained in:
Randy Heit 2015-03-14 22:04:53 -05:00
parent 5d2cbf4ecb
commit 1e7cce5a2c

View file

@ -1300,6 +1300,26 @@ void PPointer::GetTypeIDs(intptr_t &id1, intptr_t &id2) const
id2 = 0; id2 = 0;
} }
//==========================================================================
//
// NewPointer
//
// Returns a PPointer to an object of the specified type
//
//==========================================================================
PPointer *NewPointer(PType *type)
{
size_t bucket;
PType *ptype = TypeTable.FindType(RUNTIME_CLASS(PPointer), (intptr_t)type, 0, &bucket);
if (ptype == NULL)
{
ptype = new PPointer(type);
TypeTable.AddType(ptype, RUNTIME_CLASS(PPointer), (intptr_t)type, 0, bucket);
}
return static_cast<PPointer *>(ptype);
}
/* PClassPointer **********************************************************/ /* PClassPointer **********************************************************/