Exemplo n.º 1
0
        internal CountdownMemoryOwner <T> Init(IMemoryOwner <T> parent, int offset, int length, bool noOwner)
        {
            _owners = noOwner ? 0 : 1;
            if (length > parent.Memory.Length)
            {
                throw new ArgumentOutOfRangeException(nameof(length),
                                                      "Passed length is higher than internal buffer length");
            }

            _offset = offset;
            _length = length;
            _parent = parent.AddOwner();

            return(this);
        }
Exemplo n.º 2
0
 public ComplexPoolingItem Init(IMemoryOwner <int> source)
 {
     _buf = source;
     _buf.AddOwner();
     return(this);
 }