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

Add sun.misc.Unsafe::invokeCleaner

    Details

    • Resolved In Build:
      b150
    • Verification:
      Verified

      Description

      Add a method to sun.misc.Unsafe that invokes the cleaner of a direct byte buffer.

      The temporary hack of making direct byte buffer's `cleaner` field Runnable worked ok until jdk-9+148, which brought changes to setAccesssible that can restrict access to private fields in types in exported packages, see JSR 376 proposal tracked as #AwkwardStrongEncapsulation. Since invoking DBB's `cleaner` is an important use-case for some third party libraries, and until a supported means can be achieved in a future release, sun.misc.Unsafe.invokeCleaner has been added.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                chegar Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: