static
| 2642 | |
| 2643 | // static |
| 2644 | std::optional<KernelCache::CacheInfo> KernelCache::CacheInfo::Load(DeserializationContext& context) |
| 2645 | { |
| 2646 | if (!context.doc.HasMember("metadataVersion")) |
| 2647 | { |
| 2648 | LogError("Shared Cache metadata version missing"); |
| 2649 | return std::nullopt; |
| 2650 | } |
| 2651 | |
| 2652 | if (context.doc["metadataVersion"].GetUint() != METADATA_VERSION) |
| 2653 | { |
| 2654 | LogError("Shared Cache metadata version mismatch"); |
| 2655 | return std::nullopt; |
| 2656 | } |
| 2657 | |
| 2658 | CacheInfo cacheInfo; |
| 2659 | cacheInfo.MSL(images); |
| 2660 | cacheInfo.MSL(imageStarts); |
| 2661 | cacheInfo.MSL_CAST(cacheFormat, uint8_t, KernelCacheFormat); |
| 2662 | return cacheInfo; |
| 2663 | } |
| 2664 | void State::Store(SerializationContext& context, std::optional<KCViewState> viewState) const |
| 2665 | { |
| 2666 | MSS(loadedImages); |