[PATCH] D116603: [AIX][z/OS][Support] Provide alternate mapped_file_region::dontNeedImpl implementations

David Tenty via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 14:39:14 PST 2022


daltenty updated this revision to Diff 397408.
daltenty edited the summary of this revision.
daltenty added a comment.

Simply the patch since we've confirmed madvise doesn't have a useful effect on AIX anyway


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.397408.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220104/ca54c4b6/attachment.bin>


More information about the llvm-commits mailing list