From 506e08e720e93d8f1615da5bea2bac265355c885 Mon Sep 17 00:00:00 2001 From: Mikhail <99481254+DCFApixels@users.noreply.github.com> Date: Sat, 31 Aug 2024 14:57:42 +0800 Subject: [PATCH] update array utils --- src/Internal/ArraySortHalperX.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Internal/ArraySortHalperX.cs b/src/Internal/ArraySortHalperX.cs index 55fe08f..82ecfef 100644 --- a/src/Internal/ArraySortHalperX.cs +++ b/src/Internal/ArraySortHalperX.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; - +#if ENABLE_IL2CPP +using Unity.IL2CPP.CompilerServices; +#endif namespace DCFApixels.DragonECS.Internal { @@ -11,6 +13,10 @@ namespace DCFApixels.DragonECS.Internal // int Compare(T a, T b); } +#if ENABLE_IL2CPP + [Il2CppSetOption (Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] +#endif internal static class ArraySortHalperX { private const int IntrosortSizeThreshold = 16; @@ -109,6 +115,10 @@ namespace DCFApixels.DragonECS.Internal } } +#if ENABLE_IL2CPP + [Il2CppSetOption (Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] +#endif private class ComparisonHach : IComparer { public static readonly ComparisonHach Instance = new ComparisonHach(); @@ -151,6 +161,10 @@ namespace DCFApixels.DragonECS.Internal #endregion } +#if ENABLE_IL2CPP + [Il2CppSetOption (Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] +#endif internal static unsafe class UnsafeArraySortHalperX where T : unmanaged { private const int IntrosortSizeThreshold = 16;