Пример #1
0
        public BufferHandle Pin()
        {
            if (_owner != null)
            {
                return(_owner.Pin(_index));
            }
            var handle = GCHandle.Alloc(_array, GCHandleType.Pinned);

            unsafe
            {
                var pointer = OwnedBuffer <T> .Add((void *)handle.AddrOfPinnedObject(), _index);

                return(new BufferHandle(null, pointer, handle));
            }
        }
Пример #2
0
 public BufferHandle Pin() => _owner.Pin(_index);