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.
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.