diff --git a/Misaki.HighPerformance.LowLevel/Collections/UnsafeBitSet.cs b/Misaki.HighPerformance.LowLevel/Collections/UnsafeBitSet.cs index 49653a5..9b0ce91 100644 --- a/Misaki.HighPerformance.LowLevel/Collections/UnsafeBitSet.cs +++ b/Misaki.HighPerformance.LowLevel/Collections/UnsafeBitSet.cs @@ -260,7 +260,10 @@ public unsafe struct UnsafeBitSet : IDisposable, IEquatable var length = RoundToPadding(uints); _bits.Resize(length, option); - _bits.AsSpan()[oldSize..].Clear(); + if (!option.HasFlag(AllocationOption.Clear)) + { + _bits.AsSpan()[oldSize..].Clear(); + } } /// diff --git a/Misaki.HighPerformance.LowLevel/Collections/UnsafeSlotMap.cs b/Misaki.HighPerformance.LowLevel/Collections/UnsafeSlotMap.cs index b4b50d5..748c184 100644 --- a/Misaki.HighPerformance.LowLevel/Collections/UnsafeSlotMap.cs +++ b/Misaki.HighPerformance.LowLevel/Collections/UnsafeSlotMap.cs @@ -288,7 +288,7 @@ public unsafe struct UnsafeSlotMap : IUnsafeCollection public void Resize(int newSize, AllocationOption option = AllocationOption.None) { _data.Resize(newSize, option); - _generations.Resize(newSize, option); + _generations.Resize(newSize, option | AllocationOption.Clear); _freeSlots.Resize(newSize, option); _validBits.Resize(newSize, option); diff --git a/Misaki.HighPerformance.LowLevel/Misaki.HighPerformance.LowLevel.csproj b/Misaki.HighPerformance.LowLevel/Misaki.HighPerformance.LowLevel.csproj index bfed842..3fcf12f 100644 --- a/Misaki.HighPerformance.LowLevel/Misaki.HighPerformance.LowLevel.csproj +++ b/Misaki.HighPerformance.LowLevel/Misaki.HighPerformance.LowLevel.csproj @@ -6,7 +6,7 @@ enable True Misaki - 1.3.1 + 1.3.2 $(AssemblyVersion) True https://git.personalnas.com/Misaki/Misaki.HighPerformance.git diff --git a/Misaki.HighPerformance.Test/Program.cs b/Misaki.HighPerformance.Test/Program.cs index b8b78da..9154a9e 100644 --- a/Misaki.HighPerformance.Test/Program.cs +++ b/Misaki.HighPerformance.Test/Program.cs @@ -26,6 +26,6 @@ using Misaki.HighPerformance.Collections; using Misaki.HighPerformance.LowLevel.Buffer; using Misaki.HighPerformance.LowLevel.Collections; -var csm = new ConcurrentSlotMap(); +var csm = new UnsafeSlotMap(); Console.WriteLine(csm.Contains(0, 0)); Console.WriteLine(csm.Count == 0); \ No newline at end of file