[Fix] Memory was not properly released at the end of the memory test.

[Change] Hard-coded memory test loops changed from 50 to 5.
This commit is contained in:
Enrico Giordani
2015-07-18 17:53:52 +02:00
parent f3c79aab56
commit d4e26e96e9
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -267,7 +267,11 @@ void memtest_test(size_t megabytes, int passes) {
memtest_progress_end();
memtest_compare_times(m,bytes,pass,4);
}
#ifdef _WIN32
VirtualFreeEx(GetCurrentProcess(), m, 0, MEM_RELEASE);
#else
free(m);
#endif
}
void memtest_non_destructive_invert(void *addr, size_t size) {
+1 -1
View File
@@ -3672,7 +3672,7 @@ int main(int argc, char **argv) {
strcmp(argv[1], "-h") == 0) usage();
if (strcmp(argv[1], "--test-memory") == 0) {
if (argc == 3) {
memtest(atoi(argv[2]),50);
memtest(atoi(argv[2]), IF_WIN32(5, 50));
exit(0);
} else {
fprintf(stderr,"Please specify the amount of memory to test in megabytes.\n");