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

Foreign API refresh

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-panama
    • Fix Version/s: None
    • Component/s: tools

      Description

      As described here:

      https://mail.openjdk.java.net/pipermail/panama-dev/2021-September/014946.html

      There are few areas in the foreign memory access and foreign linker API that are in need of improvements:

      * dereference: there is a mismatch between API points which create segments (which take a layout) and dereference API points, which do not take layouts

      * role of memory address: in Java 17, MemoryAddress has become a stateful carrier, which is attached to a scope. This is inconvienient, as in most cases, a memory address is just a raw pointer that arises when interacting with native code.

      * resource scopes: the API for scopes has too many flavors to pick from, many of which overlap. The fact that scopes and segment allocators are unrelated forces clients to introduce ad hoc conversions from scopes to allocators, and library developers to add overloads. Finally, the API for acquiring scopes doesn't work well with try-with-resources, and could also be simplified.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: