Refactor ThreadLocal when running on hardware with more cores than PLATFORM_THREADS_LIMIT

This commit is contained in:
Wojtek Figat
2024-02-07 23:39:02 +01:00
parent eed780a0b0
commit 082768d08c
20 changed files with 147 additions and 139 deletions

View File

@@ -72,9 +72,6 @@ void EngineService::OnInit()
// Init services from front to back
auto& services = GetServices();
#if TRACY_ENABLE
Char nameBuffer[100];
#endif
for (int32 i = 0; i < services.Count(); i++)
{
const auto service = services[i];
@@ -82,6 +79,7 @@ void EngineService::OnInit()
#if TRACY_ENABLE
ZoneScoped;
int32 nameBufferLength = 0;
Char nameBuffer[100];
for (int32 j = 0; j < name.Length(); j++)
if (name[j] != ' ')
nameBuffer[nameBufferLength++] = name[j];
@@ -114,6 +112,18 @@ void EngineService::OnDispose()
const auto service = services[i];
if (service->IsInitialized)
{
#if TRACY_ENABLE
ZoneScoped;
const StringView name(service->Name);
int32 nameBufferLength = 0;
Char nameBuffer[100];
for (int32 j = 0; j < name.Length(); j++)
if (name[j] != ' ')
nameBuffer[nameBufferLength++] = name[j];
Platform::MemoryCopy(nameBuffer + nameBufferLength, TEXT("::Dispose"), 10 * sizeof(Char));
nameBufferLength += 10;
ZoneName(nameBuffer, nameBufferLength);
#endif
service->IsInitialized = false;
service->Dispose();
}