Example #1
0
        //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];
            }
        }
Example #2
0
        //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];
            }
        }
Example #3
0
 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);
     }
 }
Example #4
0
 public void DeleteArray()
 {
     MemoryManagementUnit.getInstance().Delete(m_aArrayToSort);
 }