Esempio n. 1
0
        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?");
            }
        }
Esempio n. 2
0
 /// <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());
 }