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

Can we just use mprotect in pd_commit_memory?

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 17
    • 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?

            gziemski Gerard Ziemski
            gziemski Gerard Ziemski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: