[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:
@@ -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
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user