Skip to content

Commit

Permalink
Turn on random access for Syzygy files in Windows (#1840)
Browse files Browse the repository at this point in the history
* This is the Windows version of
#1829

No functional change.
  • Loading branch information
mstembera authored and mcostalba committed Dec 23, 2018
1 parent 59d32f8 commit ae5d2c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/syzygy/tbprobe.cpp
Expand Up @@ -224,8 +224,9 @@ class TBFile : public std::ifstream {
exit(1);
}
#else
// Note FILE_FLAG_RANDOM_ACCESS is only a hint to Windows and as such may get ignored.
HANDLE fd = CreateFile(fname.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, nullptr);

if (fd == INVALID_HANDLE_VALUE)
return *baseAddress = nullptr, nullptr;
Expand Down

0 comments on commit ae5d2c3

Please sign in to comment.