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

Bulk copy from segment to array should disallow boolean layouts

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • repo-panama
    • core-libs

      Copying from a segment to an `boolean` array in bulk is problematic, as the JVM expects boolean values to be normalized. For this reasons, e.g. MemorySegment::toArray(boolean[]) is not supported.

      I believe there's a bug in that the FFM API allows to copy a memory segment to a boolean array - even though no normalization is being applied.

      I think we should disable both ValueLayout::ofBoolean (and perhaps also ValueLayout::ofAddress) from all bulk copy methods.

            Unassigned Unassigned
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: