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

SegmentAllocator:allocateUtf8String(String str) default behavior mismatch to spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • 19
    • core-libs

        As per the spec of
        https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/foreign/SegmentAllocator.html#allocateUtf8String(java.lang.String)

        the default implementation for this method copies the contents of the provided Java string into a new memory segment obtained by calling this.allocate(str.length() + 1).

        Expectations :

        invoking allocateUtf8String(String str) shall delegate a call to allocate(long)

        Actual :

        The method allocate(long) not invoked, instead allocate(long, long) is invoked.

              mcimadamore Maurizio Cimadamore
              kganapureddy Krushnareddy Ganapureddy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: