//Copies a section of the memory from another IntArray public void CopyFrom(IntArray a, int iStart, int iEnd) { int idx = 0; m_aArrayToSort = MemoryManagementUnit.getInstance().New(m_tThread, iEnd - iStart + 1); for (idx = iStart; idx <= iEnd; idx++) { m_aArrayToSort[idx - iStart] = a[idx]; } }
//Copies data from a regular array (to be called only from Main) public void CopyFrom(int[] a) { int idx = 0; m_aArrayToSort = MemoryManagementUnit.getInstance().New(m_tThread, a.Length); for (idx = 0; idx < a.Length; idx++) { m_aArrayToSort[idx] = a[idx]; } }
public int this[int iPrivateAddress] { get { if (iPrivateAddress < 0 || iPrivateAddress >= Length) { throw new IndexOutOfRangeException("Index " + iPrivateAddress + " out of bound."); } return(MemoryManagementUnit.getInstance().ValueAt(Owner, iPrivateAddress)); } set { if (iPrivateAddress < 0 || iPrivateAddress >= Length) { throw new IndexOutOfRangeException("Index " + iPrivateAddress + " out of bound."); } MemoryManagementUnit.getInstance().SetValueAt(Owner, iPrivateAddress, value); } }
public void DeleteArray() { MemoryManagementUnit.getInstance().Delete(m_aArrayToSort); }