1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added ZeroGap to AllowAppend

This commit is contained in:
Brian Fiete 2025-01-27 09:17:45 -08:00
parent ce42dc4fbe
commit 161d9dc540
19 changed files with 334 additions and 88 deletions

View file

@ -841,6 +841,9 @@ BfMethodFlags BfMethodInstance::GetMethodFlags()
else if (callingConvention == BfIRCallingConv_FastCall)
methodFlags = (BfMethodFlags)(methodFlags | BfMethodFlags_FastCall);
methodFlags = (BfMethodFlags)(methodFlags | (mMethodDef->mAppendKind * BfMethodFlags_AppendBit0));
methodFlags = (BfMethodFlags)(methodFlags | (mMethodDef->mCheckedKind * BfMethodFlags_CheckedBit0));
return methodFlags;
}
@ -2704,6 +2707,23 @@ bool BfTypeInstance::IsTypeMemberIncluded(BfTypeDef* typeDef, BfTypeDef* activeT
return genericExEntry->mConstraintsPassed;
}
bool BfTypeInstance::IsZeroGap()
{
BF_ASSERT(mDefineState >= BfTypeDefineState_Defined);
for (int fieldIdx = mFieldInstances.mSize - 1; fieldIdx >= 0; fieldIdx--)
{
auto fieldInstance = &mFieldInstances[fieldIdx];
auto fieldDef = fieldInstance->GetFieldDef();
if (fieldDef == NULL)
continue;
if ((!fieldDef->mIsStatic) && (fieldDef->mDeclaringType->IsExtension()) && (!fieldInstance->mResolvedType->IsValuelessType()))
return false;
}
return true;
}
void BfGenericTypeInfo::ReportMemory(MemReporter* memReporter)
{
memReporter->Add(sizeof(BfGenericTypeInfo));