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:
parent
818126599b
commit
2fbb8cb0f1
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user