Can we just use mprotect in pd_commit_memory?

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • tbd
    • Affects Version/s: 17
    • Component/s: hotspot
    • x86_64, aarch64

      Question came up while working on JDK-8262952

      We have 4 separate cases in the BSD "pd_commit_memory()" implementation:

      #1 __OpenBSD__
      #2 __APPLE__ with exec==true
      #3 __APPLE__ with exec==false
      #4 all other BSD

      #1 uses mprotect
      #2 uses mprotect
      #3 uses mmap
      #4 uses mmap

      For #2 mprotect must be used, mmap won't work, but for #3 we could use mprotect instead of mmap, so the question is: can't we simplify the code by using only mprotect?

            Assignee:
            Gerard Ziemski (Inactive)
            Reporter:
            Gerard Ziemski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: