static void AddBlobAssetsWithDistinctHash( byte *componentData, TypeManager.EntityOffsetInfo *blobAssetRefOffsets, int blobAssetRefCount, BlobAssetsWithDistinctHash blobAssets) { for (var i = 0; i < blobAssetRefCount; ++i) { var blobAssetRefOffset = blobAssetRefOffsets[i].Offset; var blobAssetRefPtr = (BlobAssetReferenceData *)(componentData + blobAssetRefOffset); if (blobAssetRefPtr->m_Ptr == null) { continue; } void *validationPtr = null; try { // Try to read ValidationPtr, this might throw if the memory has been unmapped validationPtr = blobAssetRefPtr->Header->ValidationPtr; } catch (Exception) { // Ignored } if (validationPtr != blobAssetRefPtr->m_Ptr) { continue; } blobAssets.TryAdd(new BlobAssetPtr(blobAssetRefPtr->Header)); } }
void AddBlobAssets( byte *componentData, TypeManager.EntityOffsetInfo *blobAssetRefOffsets, int blobAssetRefCount) { for (var i = 0; i < blobAssetRefCount; ++i) { var blobAssetRefOffset = blobAssetRefOffsets[i].Offset; var blobAssetRefPtr = (BlobAssetReferenceData *)(componentData + blobAssetRefOffset); if (blobAssetRefPtr->m_Ptr == null) { continue; } // @TODO: remove validation checks to re-enable burst void *validationPtr = null; try { // Try to read ValidationPtr, this might throw if the memory has been unmapped validationPtr = blobAssetRefPtr->Header->ValidationPtr; } catch (Exception) { } if (validationPtr != blobAssetRefPtr->m_Ptr) { continue; } if (BlobAssetsMap.TryGetValue(blobAssetRefPtr->Header->Hash, out _)) { continue; } BlobAssetsMap.TryAdd(blobAssetRefPtr->Header->Hash, BlobAssets.Length); BlobAssets.Add(new BlobAssetPtr(blobAssetRefPtr->Header)); } }