feat(core): add scalar ops and improve memory handling

Added scalar operator overloads for Vector types, fixed pointer math in Store methods, and improved enumerator and memory management. Updated test setup and removed allocation leak tests.

- Added left-hand scalar operator overloads for Vector2/3/4.
- Fixed pointer arithmetic in Store and GetUnsafePtr methods.
- Marked SetValue as readonly in UnsafeSparseSet.
- Improved enumerator initialization/reset for slot map and sparse set.
- Updated test projects' AssemblyVersion.
- Removed TestAllocationManager and added global AllocationManager setup/teardown.
- Updated TestConcurrentSlotMap for thread safety and correct cancellation.
- Minor formatting and parameter improvements.
This commit is contained in:
2026-04-03 00:00:09 +09:00
parent 8d5ed30c5d
commit c0580d2b46
12 changed files with 73 additions and 113 deletions

View File

@@ -54,7 +54,7 @@ public unsafe struct UnsafeSlotMap<T> : IUnsafeCollection<T>
public Enumerator(UnsafeSlotMap<T>* collection)
{
_collection = collection;
_currentIndex = 0;
_currentIndex = -1;
}
public bool MoveNext()
@@ -65,7 +65,7 @@ public unsafe struct UnsafeSlotMap<T> : IUnsafeCollection<T>
public void Reset()
{
_currentIndex = 0;
_currentIndex = -1;
}
public void Dispose()

View File

@@ -56,7 +56,7 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
public Enumerator(UnsafeSparseSet<T>* collection)
{
_collection = collection;
_currentIndex = 0;
_currentIndex = -1;
}
public bool MoveNext()
@@ -67,7 +67,7 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
public void Reset()
{
_currentIndex = 0;
_currentIndex = -1;
}
public readonly void Dispose()
@@ -364,7 +364,7 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
/// <param name="generation">The Generation number to validate against the stored Generation.</param>
/// <param name="value">The new value.</param>
/// <returns>True if the value was updated, false if the sparse index was not found.</returns>
public bool SetValue(int sparseIndex, int generation, T value)
public readonly bool SetValue(int sparseIndex, int generation, T value)
{
if (!Contains(sparseIndex, generation))
{
@@ -422,7 +422,7 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public readonly void* GetUnsafePtr()
{
return (T*)_dense.GetUnsafePtr() + 1;
return (T*)_dense.GetUnsafePtr();
}
/// <summary>