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

(bf) Consolidate and unify NIO Buffer memory access operations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • 17
    • core-libs
    • None

      Update the NIO Buffer implementation classes so as to consolidate memory access and make it uniform.

      The primary motivation for centralizing and unifying the memory access operations is to make it more straightforward to add new logic (e.g. live-ness checks, as per interop with the foreign memory API). Additionally, such a code structure should improve readability, testability, and maintainability, while improving confidence of correctness and consistency, e.g. reachability fences.

      There is a secondary, less obvious, benefit that comes in the form of better integration with Panama's foreign memory API, whereby ideas around resource scoping are emerging [1]. Such could be taken advantage of when performing operations that read/write into buffers from file or channel implementations, as well as potential future improvements like, say, deterministic deallocation.

      [1] https://mail.openjdk.java.net/pipermail/panama-dev/2021-January/011894.html

            pminborg Per-Ake Minborg
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: