solve 'edge' case and pass cancellation token

This commit is contained in:
Dennis Arfan 2025-08-01 22:13:13 +07:00
parent 0472bfe58e
commit d3dfdd6a74
15 changed files with 208 additions and 551 deletions

View file

@ -7,11 +7,13 @@ namespace StitchATon2.Infra.Buffers;
/// Provide non-thread safe anti GC contiguous memory.
/// </summary>
/// <typeparam name="T"></typeparam>
[Obsolete("Use immovable memory instead")]
internal sealed unsafe class UnmanagedMemory<T> : IBuffer<T> where T : unmanaged
{
internal readonly T* Pointer;
private bool _disposed;
public Memory<T> Memory => throw new NotImplementedException();
public int Length { get; }
public ref T this[int index] => ref Unsafe.AsRef<T>(Pointer + index);