From 1835e1604544a2868f9733e5985c614a8673f20e Mon Sep 17 00:00:00 2001 From: Mary Date: Mon, 8 May 2023 15:54:52 +0200 Subject: [PATCH] armeilleure: Do not call GCSettings.LargeObjectHeapCompactionMode on Android Mono only support Default as argument and will throw otherwise. --- src/ARMeilleure/Translation/PTC/Ptc.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ARMeilleure/Translation/PTC/Ptc.cs b/src/ARMeilleure/Translation/PTC/Ptc.cs index bf35e0686..23ccb6824 100644 --- a/src/ARMeilleure/Translation/PTC/Ptc.cs +++ b/src/ARMeilleure/Translation/PTC/Ptc.cs @@ -414,7 +414,10 @@ namespace ARMeilleure.Translation.PTC { ResetCarriersIfNeeded(); - GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + if (!OperatingSystem.IsAndroid()) + { + GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + } } _waitEvent.Set(); @@ -790,7 +793,10 @@ namespace ARMeilleure.Translation.PTC { ResetCarriersIfNeeded(); - GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + if (!OperatingSystem.IsAndroid()) + { + GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; + } return; }