Don't use VirtualQuery to check if the memory is valid

Calling VirtualQuery() is very expansive. For example, the testUnfold5a.C tutorial (interpreted) times out after 3600 seconds, and runs in about 60 seconds without calling VirtualQuery(). So just bypass it and return true for the time being
This commit is contained in:
Bertrand Bellenot 2018-10-03 17:35:38 +02:00 committed by sftnight
parent 818126599b
commit 2fbb8cb0f1

View File

@ -536,6 +536,11 @@ std::string NormalizePath(const std::string& Path) {
}
bool IsMemoryValid(const void *P) {
// Calling VirtualQuery() is very expansive. For example, the testUnfold5a
// tutorial (interpreted) times out after 3600 seconds, and runs in about
// 60 seconds without calling VirtualQuery(). So just bypass it and return
// true for the time being
return true;
MEMORY_BASIC_INFORMATION MBI;
if (::VirtualQuery(P, &MBI, sizeof(MBI)) == 0) {
ReportLastError("VirtualQuery");