SegmentAllocator:allocate() can return null some cases

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 19
    • Affects Version/s: 19
    • Component/s: core-libs

        Observed that allocate(bytesSize) and allocate(bytesSize, alignment) might throw OutOfMemoryError when bytesSize is too long.

        IMO, this can be stated in spec.

        And also observed that allocate(bytesSize, alignment) can return null, with
        ====
         SegmentAllocator segmentAllocator = SegmentAllocator.newNativeArena(MemorySession.openConfined());
                MemorySegment memorySegment = segmentAllocator.allocate(Long.MAX_VALUE, 2);
                System.out.println(" The memorySegment is " + memorySegment);
        ====

        If this is a valid case Spec can be enhanced for this.

              Assignee:
              Maurizio Cimadamore
              Reporter:
              Krushnareddy Ganapureddy
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: