void CMemTest::RunAllTests(int total_threads) { Zerofilling(); Free_NULL(); InvariantDataRealloc(/*aligned=*/false, 8*MByte, /*checkData=*/true); if (Raligned_realloc) InvariantDataRealloc(/*aligned=*/true, 8*MByte, /*checkData=*/true); TestAlignedParameters(); UniquePointer(); AddrArifm(); #if __APPLE__ REPORT("Known issue: some tests are skipped on macOS\n"); #else NULLReturn(1*MByte,100*MByte,total_threads); #endif if (FullLog) REPORT("Tests for %d threads ended\n", total_threads); }
void CMemTest::RunAllTests(int total_threads) { Zerofilling(); Free_NULL(); InvariantDataRealloc(/*aligned=*/false); if (Raligned_realloc) InvariantDataRealloc(/*aligned=*/true); TestAlignedParameters(); #if __APPLE__ REPORT("Known issue: some tests are skipped on Mac OS* X\n"); #else UniquePointer(); AddrArifm(); NULLReturn(1*MByte,100*MByte,total_threads); #endif if (FullLog) REPORT("All tests ended\nclearing memory..."); }
void CheckReallocLeak() { int i; const int ITER_TO_STABILITY = 10; // do bootstrap for (int k=0; k<3; k++) InvariantDataRealloc(/*aligned=*/false, 128*MByte, /*checkData=*/false); size_t prev = GetMemoryUsage(peakUsage); // expect realloc to not increase peak memory consumption after ITER_TO_STABILITY-1 iterations for (i=0; i<ITER_TO_STABILITY; i++) { for (int k=0; k<3; k++) InvariantDataRealloc(/*aligned=*/false, 128*MByte, /*checkData=*/false); size_t curr = GetMemoryUsage(peakUsage); if (prev == curr) break; prev = curr; } ASSERT(i < ITER_TO_STABILITY, "Can't stabilize memory consumption."); }