Beispiel #1
0
 public static ref T Get(ref Buffer <T> buffer, int index)
 {
     Debug.Assert(index >= 0 && index < buffer.length, "Index out of range.");
     return(ref Get(buffer.Memory, index));
 }
Beispiel #2
0
 public void Slice(int start, int count, out Buffer <T> sliced)
 {
     ValidateRegion(start, count);
     sliced = new Buffer <T>(Memory + Unsafe.SizeOf <T>() * start, count, Id);
 }
 public unsafe void Return<T>(ref Buffer<T> buffer) where T : struct
 {
     ReturnUnsafely(buffer.Id);
     buffer = default;
 }