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

Refactor native library loading implementation

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 15
    • None
    • core-libs
    • None

    Description

      See https://mail.openjdk.java.net/pipermail/core-libs-dev/2019-July/061268.html

      A few ideas of potential clean up:

      1. ClassLoader::sys_paths is the library path for boot loader whereas ClassLoader::usr_paths is the library path for user-defined loaders

      We should consider refactoring the native library loading implementation
      such that ClassLoader::loadLibrary can delegate to BootLoader::loadLibrary
      and the permission checks for user-defined loader is not needed for the boot loader. So BootLoader::loadLibrary can further be optimized.

      2. This refactoring enables Panama LibraryLookup to load a native library without the limitation to restrict only lookups from the same class loader can access functions from a native library.

      JDK-8236075 has addressed the potential race in initializing sys_paths and usr_paths.

      Attachments

        Issue Links

          Activity

            People

              mchung Mandy Chung
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: