Optimize CSharp scripting runtime to use arena allocator per-assembly

This commit is contained in:
Wojtek Figat
2025-05-25 02:04:16 +02:00
parent f9cb4ddae2
commit 410ec0465c
15 changed files with 126 additions and 78 deletions

View File

@@ -21,15 +21,16 @@ class FLAXENGINE_API MMethod
protected:
#if USE_MONO
MonoMethod* _monoMethod;
StringAnsi _name;
#elif USE_NETCORE
void* _handle;
StringAnsiView _name;
int32 _paramsCount;
mutable void* _returnType;
mutable Array<void*, InlinedAllocation<8>> _parameterTypes;
void CacheSignature() const;
#endif
MClass* _parentClass;
StringAnsi _name;
MVisibility _visibility;
#if !USE_MONO_AOT
void* _cachedThunk = nullptr;
@@ -48,12 +49,11 @@ public:
explicit MMethod(MonoMethod* monoMethod, MClass* parentClass);
explicit MMethod(MonoMethod* monoMethod, const char* name, MClass* parentClass);
#elif USE_NETCORE
MMethod(MClass* parentClass, StringAnsi&& name, void* handle, int32 paramsCount, MMethodAttributes attributes);
MMethod(MClass* parentClass, StringAnsiView name, void* handle, int32 paramsCount, MMethodAttributes attributes);
#endif
public:
#if COMPILE_WITH_PROFILER
StringAnsi ProfilerName;
SourceLocationData ProfilerData;
#endif
@@ -109,7 +109,7 @@ public:
/// <summary>
/// Gets the method name.
/// </summary>
FORCE_INLINE const StringAnsi& GetName() const
FORCE_INLINE StringAnsiView GetName() const
{
return _name;
}