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

Method GetMemoryUsage

Source/Engine/Content/BinaryAsset.cpp:478–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478uint64 BinaryAsset::GetMemoryUsage() const
479{
480 Locker.Lock();
481 uint64 result = Asset::GetMemoryUsage();
482 result += sizeof(BinaryAsset) - sizeof(Asset);
483 result += _dependantAssets.Capacity() * sizeof(BinaryAsset*);
484 for (int32 i = 0; i < ASSET_FILE_DATA_CHUNKS; i++)
485 {
486 auto chunk = _header.Chunks[i];
487 if (chunk != nullptr && chunk->IsLoaded())
488 result += chunk->Size();
489 }
490 Locker.Unlock();
491 return result;
492}
493
494/// <summary>
495/// Helper task used to initialize binary asset and upgrade it if need to in background.

Callers

nothing calls this directly

Calls 5

LockMethod · 0.80
UnlockMethod · 0.80
CapacityMethod · 0.45
IsLoadedMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected