reverted the failsafe removal, since they dropped support for dll check

This commit is contained in:
Concedo 2023-08-31 15:39:32 +08:00
parent b6914ebd04
commit e2fd30b5d1
4 changed files with 32 additions and 11 deletions

View file

@ -612,6 +612,7 @@ struct llama_mmap {
throw std::runtime_error(format("MapViewOfFile failed: %s", llama_format_win_err(error).c_str()));
}
#ifndef USE_FAILSAFE
#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
if (prefetch) {
// Advise the kernel to preload the mapped memory
@ -626,6 +627,9 @@ struct llama_mmap {
#else
#pragma message("warning: You are building for pre-Windows 8; prefetch not supported")
#endif // _WIN32_WINNT >= _WIN32_WINNT_WIN8
#else
printf("\nPrefetchVirtualMemory skipped in compatibility mode.\n");
#endif
}
~llama_mmap() {