You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I updated from 0.8.1 to 0.8.2, I started getting the following exception when trying to use the CompressionStream class:
System.TypeInitializationException: The type initializer for 'ZstdSharp.Unsafe.Methods' threw an exception.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Runtime.CompilerServices.RuntimeHelpers.AllocateTypeAssociatedMemory(Type type, Int32 size)
at ZstdSharp.Unsafe.Methods..cctor()
--- End of inner exception stack trace ---
at ZstdSharp.SafeCctxHandle.Create()
at ZstdSharp.Compressor..ctor(Int32 level)
at ZstdSharp.CompressionStream..ctor(Stream stream, Int32 level, Int32 bufferSize, Boolean leaveOpen)
Apparently RuntimeHelpers.AllocateTypeAssociatedMemory is not implemented in Mono until .NET 9, but this method should not be called in .NET 7+. Will submit a fix soon.
Activity
oleg-st commentedon Nov 18, 2024
@teo-tsirpanis Do you know the right way to handle it?
teo-tsirpanis commentedon Nov 18, 2024
Apparently
RuntimeHelpers.AllocateTypeAssociatedMemoryis not implemented in Mono until .NET 9, but this method should not be called in .NET 7+. Will submit a fix soon.oleg-st commentedon Nov 20, 2024
https://github.com/dotnet/BenchmarkDotNet/blob/c7ed714a34a4de04f7320b6d971a51b04545bb1c/src/BenchmarkDotNet/Portability/RuntimeInformation.cs#L35
I think first option is better.
oleg-st commentedon Nov 22, 2024
Fixed in 0.8.3