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; } }
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); } }
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)); } }
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)); } }
public static void RemoveN() { m_n = null; }