MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetGroups

Method GetGroups

Source/Engine/Profiler/ProfilerMemory.cpp:387–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387ProfilerMemory::GroupsArray ProfilerMemory::GetGroups(int32 mode)
388{
389 GroupsArray result;
390 Platform::MemoryClear(&result, sizeof(result));
391 static_assert(ARRAY_COUNT(result.Values) >= (int32)Groups::MAX, "Update group array size.");
392 if (mode == 0)
393 {
394 for (int32 i = 0; i < (int32)Groups::MAX; i++)
395 result.Values[i] = Platform::AtomicRead(&GroupMemory[i]);
396 }
397 else if (mode == 1)
398 {
399 for (int32 i = 0; i < (int32)Groups::MAX; i++)
400 result.Values[i] = Platform::AtomicRead(&GroupMemoryPeek[i]);
401 }
402 else if (mode == 2)
403 {
404 for (int32 i = 0; i < (int32)Groups::MAX; i++)
405 result.Values[i] = Platform::AtomicRead(&GroupMemoryCount[i]);
406 }
407 return result;
408}
409
410void ProfilerMemory::Dump(const StringView& options)
411{

Callers 1

UpdateMethod · 0.80

Calls 2

MemoryClearFunction · 0.85
AtomicReadFunction · 0.50

Tested by

no test coverage detected