Optimize editor profiler native allocations when capturing data

This commit is contained in:
Wojtek Figat
2025-06-09 15:23:31 +02:00
parent 057ec9d41e
commit d7ff9fdade
7 changed files with 83 additions and 3 deletions

View File

@@ -800,6 +800,23 @@ void Content::deleteFileSafety(const StringView& path, const Guid& id)
#endif
}
#if !COMPILE_WITHOUT_CSHARP
#include "Engine/Scripting/ManagedCLR/MUtils.h"
void* Content::GetAssetsInternal()
{
AssetsLocker.Lock();
MArray* result = MCore::Array::New(Asset::TypeInitializer.GetClass(), Assets.Count());
int32 i = 0;
for (const auto& e : Assets)
MCore::GC::WriteArrayRef(result, e.Value->GetOrCreateManagedInstance(), i++);
AssetsLocker.Unlock();
return result;
}
#endif
#if USE_EDITOR
bool Content::RenameAsset(const StringView& oldPath, const StringView& newPath)