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

@@ -3,6 +3,7 @@
#pragma once
#include "Engine/Core/Collections/Array.h"
#include "Engine/Core/Memory/ArenaAllocation.h"
#include "MTypes.h"
/// <summary>
@@ -32,7 +33,7 @@ protected:
mutable int32 _hasCachedAttributes : 1;
int32 _isStatic : 1;
mutable Array<MObject*> _attributes;
mutable Array<MObject*, ArenaAllocation> _attributes;
public:
#if USE_MONO
@@ -157,5 +158,5 @@ public:
/// Returns an instance of all attributes connected with given field. Returns null if the field doesn't have any attributes.
/// </summary>
/// <returns>The array of attribute objects.</returns>
const Array<MObject*>& GetAttributes() const;
const Array<MObject*, ArenaAllocation>& GetAttributes() const;
};