public Pinner(IDataAccessor <System.UInt16> i) { if (i is IUnmanagedDataAccessor <System.UInt16> ) { ptr = ((IUnmanagedDataAccessor <System.UInt16>)i).Pointer.ToPointer(); } else { m_handle = GCHandle.Alloc(i.AsArray(), GCHandleType.Pinned); ptr = m_handle.AddrOfPinnedObject().ToPointer(); } if (ptr == null) { throw new Exception("Null pointer allocation?"); } }
/// <summary> /// Gets the real underlying data as a managed array, accessing this property may flush pending executions /// </summary> public T[] AsArray() { return(m_data.AsArray()); }