Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8266566

Can we just use mprotect in pd_commit_memory?

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 17
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64, aarch64

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gziemski Gerard Ziemski
              Reporter:
              gziemski Gerard Ziemski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: