[lld] [lld][MachO] Follow-up to use madvise() for threaded file page-in. (PR #157917)

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 12:21:54 PDT 2025


================
@@ -349,13 +352,19 @@ void multiThreadedPageInBackground(DeferredFiles &deferred) {
       return;
 #ifndef NDEBUG
     totalBytes += buff.size();
-    numDeferedFilesTouched += 1;
+    numDeferedFilesAdvised += 1;
 #endif
 
+#if _WIN32
----------------
aganea wrote:

I would put all this in a API declared in `llvm/include/llvm/Support/Memory.h` and defined in `llvm/lib/Support/Windows/Memory.inc` for Windows and `llvm/lib/Support/Unix/Memory.inc` for Unix/MacOS. Perhaps something like `Memory::prefetchMappedMemory` to be in line with the other APIs there.

https://github.com/llvm/llvm-project/pull/157917


More information about the llvm-commits mailing list