MapViewOfFileExNuma is only present when _WIN32_WINNT >= 0x0600 (Windows Vista
or later). The code is passing NUMA_NO_PREFERRED_MODE, and that is documented 
as:

No NUMA node is preferred. This is the same as calling the MapViewOfFileEx 
function.

https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-mapviewoffileexnuma

So, MapViewOfFileEx will behave identically, while still allowing Windows XP 
support.

libgfortran/ChangeLog:

        * caf/shmem/shared_memory.c (shared_memory_init): Use MapViewOfFileEx 
instead of MapViewOfFileExNuma.

Signed-off-by: Peter Damianov <[email protected]>
---
 libgfortran/caf/shmem/shared_memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgfortran/caf/shmem/shared_memory.c 
b/libgfortran/caf/shmem/shared_memory.c
index afafd50f80b..a2520a89cc7 100644
--- a/libgfortran/caf/shmem/shared_memory.c
+++ b/libgfortran/caf/shmem/shared_memory.c
@@ -234,8 +234,8 @@ shared_memory_init (shared_memory_act *mem, size_t size)
     }
 #elif defined(WIN32)
   mem->glbl.base
-    = (LPTSTR) MapViewOfFileExNuma (mem->shm_fd, FILE_MAP_ALL_ACCESS, 0, 0,
-                                   size, base_ptr, NUMA_NO_PREFERRED_NODE);
+    = (LPTSTR) MapViewOfFileEx (mem->shm_fd, FILE_MAP_ALL_ACCESS, 0, 0,
+                               size, base_ptr);
   if (mem->glbl.base == NULL)
     {
       perror ("MapViewOfFile failed");
-- 
2.54.0

Reply via email to