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

Older method used in Slicing Allocators examples

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Delivered
    • Icon: P4 P4
    • 23
    • None
    • docs
    • None

      The slicing allocators examples from https://docs.oracle.com/en/java/javase/23/core/slicing-allocators-and-slicing-memory-segments.html#GUID-F942E810-4B2F-47BF-9374-DC52A998CA43 use the allocateArray method which no longer exists in the current API (https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/lang/foreign/SegmentAllocator.html):

      1. allocateArray is present in the first code snippet: s[i] = allocator.allocateArray(
                      ValueLayout.JAVA_INT, 1, 2, 3, 4, 5);
      2. allocateArray is also in the second code snippet: return slicingAllocator.allocateArray(elementLayout, elements);

      Instead, these examples should use the SegmentAllocator::allocateFrom method.

            rgallard Raymond Gallardo
            amihalceanu Ana-Maria Mihalceanu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: