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

MemorySegment::allocateNative should be tolerant of zero-sized allocation requests

    XMLWordPrintable

Details

    Description

      MemorySegment::allocateNative throws IllegalArgumentException if its size parameter is <= 0. This seems to be inconsistent with the fact that Unsafe::allocate/freeMemory seems to be tolerant of that, and that you can still create zero-sized segments from e.g. direct buffers (or Java arrays).

      This is discussed in more details here:
      https://mail.openjdk.java.net/pipermail/panama-dev/2022-January/016071.html

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: