public MemoryGroupView(MemoryGroup <T> owner) { this.owner = owner; this.memoryWrappers = new MemoryOwnerWrapper[owner.Count]; for (int i = 0; i < owner.Count; i++) { this.memoryWrappers[i] = new MemoryOwnerWrapper(this, i); } }
/// <summary> /// Initializes a new instance of the <see cref="Buffer2D{T}"/> class. /// </summary> /// <param name="memoryGroup">The <see cref="MemoryGroup{T}"/> to wrap.</param> /// <param name="width">The number of elements in a row.</param> /// <param name="height">The number of rows.</param> internal Buffer2D(MemoryGroup <T> memoryGroup, int width, int height) { this.FastMemoryGroup = memoryGroup; this.Width = width; this.Height = height; if (memoryGroup.Count == 1) { this.cachedMemory = memoryGroup[0]; } }
internal MemoryGroupEnumerator(MemoryGroup <T> .Consumed memoryGroup) { this.memoryGroup = memoryGroup; this.count = memoryGroup.Count; this.index = -1; }
internal void Invalidate() { this.owner = null; }