Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand All @@ -21,13 +21,19 @@ public struct B2FixedArray1<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}
}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray1024.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -1044,14 +1044,20 @@ public struct B2FixedArray1024<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray11.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -31,13 +31,19 @@ public struct B2FixedArray11<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}
}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray12.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -32,14 +32,20 @@ public struct B2FixedArray12<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray16.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -36,13 +36,19 @@ public struct B2FixedArray16<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}
}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray2.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -28,14 +28,20 @@ public B2FixedArray2(T v0000, T v0001)
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray24.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -44,14 +44,20 @@ public struct B2FixedArray24<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray3.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand All @@ -23,14 +23,20 @@ public struct B2FixedArray3<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray32.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -52,14 +52,20 @@ public struct B2FixedArray32<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray4.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand All @@ -24,13 +24,19 @@ public struct B2FixedArray4<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}
}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray64.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -84,14 +84,20 @@ public struct B2FixedArray64<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
12 changes: 9 additions & 3 deletions src/Box2D.NET/B2FixedArray7.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -27,14 +27,20 @@ public struct B2FixedArray7<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
14 changes: 10 additions & 4 deletions src/Box2D.NET/B2FixedArray8.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-FileCopyrightText: 2025 Ikpil Choi(ikpil@naver.com)
// SPDX-License-Identifier: MIT

using System;
Expand Down Expand Up @@ -28,14 +28,20 @@ public struct B2FixedArray8<T> where T : unmanaged
public ref T this[int index]
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => ref AsSpan()[index];
get => ref AsSpanUnsafe()[index];
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
internal Span<T> AsSpanUnsafe()
{
return MemoryMarshal.CreateSpan(ref _v0000, Size);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly ReadOnlySpan<T> AsReadOnlySpan()
{
return MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in _v0000), Size);
}

}
}
}
Loading
Loading