mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
429 B
26 lines
429 B
using System;
|
|
using System.Buffers;
|
|
|
|
/*https://github.com/sidristij/memory-pools*/
|
|
|
|
namespace MemoryPools.Memory
|
|
{
|
|
public class MemoryOwner<T>
|
|
: IMemoryOwner<T>
|
|
{
|
|
public static MemoryOwner<T> Empty = new MemoryOwner<T>(Memory<T>.Empty);
|
|
|
|
protected MemoryOwner(Memory<T> memory)
|
|
{
|
|
Memory = memory;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Memory = Memory<T>.Empty;
|
|
}
|
|
|
|
public Memory<T> Memory { get; set; }
|
|
}
|
|
}
|