diff --git a/src/Internal/Allocators/AllocatorUtility.cs b/src/Internal/Allocators/AllocatorUtility.cs index cfc092f..b801555 100644 --- a/src/Internal/Allocators/AllocatorUtility.cs +++ b/src/Internal/Allocators/AllocatorUtility.cs @@ -1,8 +1,16 @@ using System; using System.Runtime.CompilerServices; using static DCFApixels.DragonECS.Core.Internal.MemoryAllocator; +#if ENABLE_IL2CPP +using Unity.IL2CPP.CompilerServices; +#endif + namespace DCFApixels.DragonECS.Core.Internal { +#if ENABLE_IL2CPP + [Il2CppSetOption(Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] +#endif internal static unsafe class AllocatorUtility { public static void ClearAllocatedMemory(IntPtr ptr, int startByte, int lengthInBytes) diff --git a/src/Internal/Allocators/MemoryAllocator.cs b/src/Internal/Allocators/MemoryAllocator.cs index 8828357..84face2 100644 --- a/src/Internal/Allocators/MemoryAllocator.cs +++ b/src/Internal/Allocators/MemoryAllocator.cs @@ -2,7 +2,6 @@ #undef DEBUG #endif using System; -using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -455,7 +454,7 @@ namespace DCFApixels.DragonECS.Core.Internal } [StructLayout(LayoutKind.Explicit)] - private unsafe struct Union + private struct Union { [FieldOffset(0)] public Array array; diff --git a/src/Pools/EcsPool.cs b/src/Pools/EcsPool.cs index 4bd629e..40d2629 100644 --- a/src/Pools/EcsPool.cs +++ b/src/Pools/EcsPool.cs @@ -26,6 +26,7 @@ namespace DCFApixels.DragonECS /// Pool for IEcsComponent components #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] [MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.POOLS_GROUP)] diff --git a/src/Pools/EcsTagPool.cs b/src/Pools/EcsTagPool.cs index 9517938..c2b25ec 100644 --- a/src/Pools/EcsTagPool.cs +++ b/src/Pools/EcsTagPool.cs @@ -26,6 +26,7 @@ namespace DCFApixels.DragonECS /// Pool for IEcsTagComponent components. #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] [MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.POOLS_GROUP)] diff --git a/src/Pools/EcsValuePool.cs b/src/Pools/EcsValuePool.cs index e22d420..a64a6eb 100644 --- a/src/Pools/EcsValuePool.cs +++ b/src/Pools/EcsValuePool.cs @@ -38,6 +38,7 @@ namespace DCFApixels.DragonECS /// Pool for IEcsValueComponent components #if ENABLE_IL2CPP [Il2CppSetOption(Option.NullChecks, false)] + [Il2CppSetOption(Option.ArrayBoundsChecks, false)] #endif [MetaColor(MetaColor.DragonRose)] [MetaGroup(EcsConsts.PACK_GROUP, EcsConsts.POOLS_GROUP)]