Optimize dynamic memory allocations for managed runtime interop collections with a new Arena Allocation

This commit is contained in:
Wojtek Figat
2025-05-25 17:39:20 +02:00
parent 9aaba955d0
commit 8c62f1120f
13 changed files with 185 additions and 55 deletions

View File

@@ -1539,7 +1539,7 @@ MObject* MClass::GetAttribute(const MClass* klass) const
return attrInfo ? mono_custom_attrs_get_attr(attrInfo, klass->GetNative()) : nullptr;
}
const Array<MObject*>& MClass::GetAttributes() const
const Array<MObject*, ArenaAllocation>& MClass::GetAttributes() const
{
if (_hasCachedAttributes)
return _attributes;
@@ -1662,7 +1662,7 @@ MObject* MEvent::GetAttribute(const MClass* klass) const
return foundAttr;
}
const Array<MObject*>& MEvent::GetAttributes() const
const Array<MObject*, ArenaAllocation>& MEvent::GetAttributes() const
{
if (_hasCachedAttributes)
return _attributes;
@@ -1815,7 +1815,7 @@ MObject* MField::GetAttribute(const MClass* klass) const
return foundAttr;
}
const Array<MObject*>& MField::GetAttributes() const
const Array<MObject*, ArenaAllocation>& MField::GetAttributes() const
{
if (_hasCachedAttributes)
return _attributes;
@@ -1988,7 +1988,7 @@ MObject* MMethod::GetAttribute(const MClass* klass) const
return foundAttr;
}
const Array<MObject*>& MMethod::GetAttributes() const
const Array<MObject*, ArenaAllocation>& MMethod::GetAttributes() const
{
if (_hasCachedAttributes)
return _attributes;
@@ -2118,7 +2118,7 @@ MObject* MProperty::GetAttribute(const MClass* klass) const
return foundAttr;
}
const Array<MObject*>& MProperty::GetAttributes() const
const Array<MObject*, ArenaAllocation>& MProperty::GetAttributes() const
{
if (_hasCachedAttributes)
return _attributes;