Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ public class ZstandardStreamUnitTests : CompressionStreamUnitTestBase
public override Stream CreateStream(Stream stream, CompressionMode mode, bool leaveOpen) => new ZstandardStream(stream, mode, leaveOpen);
public override Stream CreateStream(Stream stream, CompressionLevel level)
{
if (PlatformDetection.Is32BitProcess && level == CompressionLevel.SmallestSize)
if ((PlatformDetection.Is32BitProcess || PlatformDetection.IsAppleMobile) && level == CompressionLevel.SmallestSize)
{
// Zstandard smallest size requires too much working memory
// (800+ MB) and causes intermittent allocation errors on 32-bit
// processes in CI.
// processes and on memory-constrained Apple mobile devices (iOS/tvOS/MacCatalyst) in CI.
level = CompressionLevel.Optimal;
}

return new ZstandardStream(stream, level);
}
public override Stream CreateStream(Stream stream, CompressionLevel level, bool leaveOpen)
{
if (PlatformDetection.Is32BitProcess && level == CompressionLevel.SmallestSize)
if ((PlatformDetection.Is32BitProcess || PlatformDetection.IsAppleMobile) && level == CompressionLevel.SmallestSize)
{
// Zstandard smallest size requires too much working memory
// (800+ MB) and causes intermittent allocation errors on 32-bit
// processes in CI.
// processes and on memory-constrained Apple mobile devices (iOS/tvOS/MacCatalyst) in CI.
level = CompressionLevel.Optimal;
}

Expand Down
Loading