Esempio n. 1
0
        public static bool RunTest(int iObj)
        {

            GC.Collect();
            if (m_o != m_n.p)
            {
                return false;
            }

            m_n = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();
            
            for( int i=0; i< iObj; i++ )
            {
                pinList[i] = null;
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();
           
            if( cFinalObj == cCreatObj )
            {
                return true;
            }
            else
            {
                Console.Write(cCreatObj-cFinalObj);
                Console.WriteLine (" objects have been finalized!" );
                return false;
            }

        }
Esempio n. 2
0
        public static bool RunTest(int iObj)
        {
            GC.Collect();
            if (m_o != m_n.p)
            {
                return(false);
            }

            m_n = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            for (int i = 0; i < iObj; i++)
            {
                pinList[i] = null;
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            if (cFinalObj == cCreatObj)
            {
                return(true);
            }
            else
            {
                Console.Write(cCreatObj - cFinalObj);
                Console.WriteLine(" objects have been finalized!");
                return(false);
            }
        }
Esempio n. 3
0
 public static void CreateObj(int iObj)
 {
     pinList = new Object[iObj];
     m_o     = new int[100];
     for (int i = 0; i < iObj; i++)
     {
         m_o = new int[100];
         m_n = new NDPinFinal(m_o, GCHandle.Alloc(m_o, GCHandleType.Pinned));
     }
 }
Esempio n. 4
0
        public static void CreateObj(int iObj) {

            pinList = new Object[iObj];
            m_o = new int[100];
            for (int i = 0; i < iObj; i++)
            {
                m_o = new int[100];
                m_n = new NDPinFinal (m_o, GCHandle.Alloc(m_o, GCHandleType.Pinned));
            }
        }
Esempio n. 5
0
 public static void RemoveN()
 {
     m_n = null;
 }