]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgfortran: Use MapViewOfFileEx instead of MapViewOfFileExNuma in caf_shmem
authorPeter Damianov <peter0x44@disroot.org>
Fri, 29 May 2026 06:53:42 +0000 (08:53 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Fri, 29 May 2026 06:53:42 +0000 (08:53 +0200)
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.

libgfortran/caf/shmem/shared_memory.c

index afafd50f80b1c9a598415106763612bb8b1a5f5b..a2520a89cc7b49bac263b1f82ff9e98ea5b083fe 100644 (file)
@@ -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");