Update Job

This commit is contained in:
2026-02-21 17:20:51 +09:00
parent 4f964b2d2a
commit 7367826978
23 changed files with 511 additions and 276 deletions

View File

@@ -101,6 +101,23 @@ public unsafe struct UnsafeQueue<T> : IUnsafeCollection<T>
return ref UnsafeUtility.ReadArrayElementRef<T>(_array.GetUnsafePtr(), _offset);
}
/// <summary>
/// Attempts to return the object at the top of the collection without removing it.
/// </summary>
/// <param name="value">The item at the front of the queue if the operation is successful; otherwise, the default value of <typeparamref name="T"/>.</param>
/// <returns><see langword="true"/> if an object was returned successfully; otherwise, <see langword="false"/>.</returns>
public readonly bool TryPeek(out T value)
{
if (_count == 0)
{
value = default;
return false;
}
value = _array[_offset];
return true;
}
/// <summary>
/// Adds an element to the end of a collection, resizing if the current capacity is reached. The new element is
/// stored in a circular buffer.

View File

@@ -181,6 +181,23 @@ public unsafe struct UnsafeStack<T> : IUnsafeCollection<T>
return _array[_count - 1];
}
/// <summary>
/// Attempts to return the item at the top of the stack without removing it.
/// </summary>
/// <param name="value">When this method returns, contains the item at the top of the stack if the stack is not empty; otherwise, the default value of <typeparamref name="T"/>.</param>
/// <returns><see langword="true"/> if an item was successfully returned; otherwise, <see langword="false"/>.</returns>
public readonly bool TryPeek(out T value)
{
if (_count == 0)
{
value = default;
return false;
}
value = _array[_count - 1];
return true;
}
public void Resize(int newSize, AllocationOption option = AllocationOption.None)
{
_array.Resize(newSize, option);

View File

@@ -8,7 +8,6 @@
<Authors>Misaki</Authors>
<AssemblyVersion>1.3.5</AssemblyVersion>
<Version>$(AssemblyVersion)</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageProjectUrl>https://git.personalnas.com/Misaki/Misaki.HighPerformance.git</PackageProjectUrl>
<RepositoryUrl>https://git.personalnas.com/Misaki/Misaki.HighPerformance.git</RepositoryUrl>
<IncludeSymbols>True</IncludeSymbols>