[PATCH] D116603: [AIX][z/OS][Support] Provide no-op mapped_file_region::dontNeedImpl implementation

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 07:21:14 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb2f34d6af1b8: [AIX][z/OS][Support] Provide alternate no-op mapped_file_region::dontNeedImpl… (authored by daltenty).

Changed prior to commit:
  https://reviews.llvm.org/D116603?vs=397408&id=397569#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116603/new/

https://reviews.llvm.org/D116603

Files:
  llvm/lib/Support/Unix/Path.inc


Index: llvm/lib/Support/Unix/Path.inc
===================================================================
--- llvm/lib/Support/Unix/Path.inc
+++ llvm/lib/Support/Unix/Path.inc
@@ -872,8 +872,13 @@
 
 void mapped_file_region::dontNeedImpl() {
   assert(Mode == mapped_file_region::readonly);
+#if defined(__MVS__) || defined(_AIX)
+  // If we don't have madvise, or it isn't beneficial, treat this as a no-op.
+  return;
+#else
   if (Mapping)
     ::madvise(Mapping, Size, MADV_DONTNEED);
+#endif
 }
 
 int mapped_file_region::alignment() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116603.397569.patch
Type: text/x-patch
Size: 541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220105/cd851de3/attachment.bin>


More information about the llvm-commits mailing list