| 476 | } |
| 477 | |
| 478 | uint64 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. |