Skip to content

Commit

Permalink
Use PrefetchVirtualMemory for Win mmap
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Apr 16, 2024
1 parent 1496229 commit 58e1c38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/util/src/os/win/win_mmap_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ class MapHolder : public ov::MappedMemory {
0, // offset_align >> 32,
0, // offset_align & 0xffffffff,
m_size);

WIN32_MEMORY_RANGE_ENTRY memoryRange;
memoryRange.VirtualAddress = m_data;
memoryRange.NumberOfBytes = m_size;

HANDLE hProcess = GetCurrentProcess();
PrefetchVirtualMemory(hProcess, 1, &memoryRange, 0);

if (!m_data) {
throw std::runtime_error("Can not create map view for " + path);
}
Expand Down

0 comments on commit 58e1c38

Please sign in to comment.