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

(bf) Remove unused ARRAY_BASE_OFFSET, ARRAY_INDEX_SCALE from read-only Heap Buffers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 19
    • None
    • core-libs
    • None
    • b11

    Description

      Two fields in Heap Buffers are unconditionally declared. But they are unused in read-only buffer classes.

          // Cached array base offset
          private static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset($type$[].class);

          // Cached array index scale
          private static final long ARRAY_INDEX_SCALE = UNSAFE.arrayIndexScale($type$[].class);

      Affected classes: HeapByteBufferR, HeapCharBufferR, HeapDoubleBufferR, HeapFloatBufferR, HeapIntBufferR, HeapLongBufferR, HeapShortBufferR.

      By widening '#if[rw]' we can remove redundant fields.

      Attachments

        Issue Links

          Activity

            People

              aturbanov Andrey Turbanov
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: