<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi, some answers below:</p>
    <p>(1) refers to the ability to query what primitive layouts are
      like, using Linker::canonicalLayouts.<br>
      See:
<a class="moz-txt-link-freetext" href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/Linker.html#canonicalLayouts()">https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/Linker.html#canonicalLayouts()</a></p>
    <p>(2) refers to the new methods in MemoryLayout, namely
      MemoryLayout::scale/scaleHandle, together with the fact that now
      all var handles generated by this API take a start offset (so they
      are easier to combine).<br>
      see:
<a class="moz-txt-link-freetext" href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/Linker.html#canonicalLayouts()">https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/Linker.html#canonicalLayouts()</a><br>
      <br>
      (3) refers to the fact that you can now read and write strings
      with more charsets than just UTF8. You can now use any charset in
      StandardCharsets (to which we have added UTF32, for good measure).<br>
      see:
<a class="moz-txt-link-freetext" href="https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/MemorySegment.html#getString(long,java.nio.charset.Charset)">https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/foreign/MemorySegment.html#getString(long,java.nio.charset.Charset)</a><br>
    </p>
    <div class="moz-cite-prefix">Maurizio<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 07/06/2024 23:30, Cheng Jin wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:SJ2PR15MB5689C36C5751FA14ACB6E9A5F5FB2@SJ2PR15MB5689.namprd15.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
        {font-family:Aptos;}@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;}div.WordSection1
        {page:WordSection1;}ol
        {margin-bottom:0cm;}ul
        {margin-bottom:0cm;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Hi there, <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I’ve got a
            question about JEP454 at  <a href="https://openjdk.org/jeps/454" moz-do-not-send="true" class="moz-txt-link-freetext">https://openjdk.org/jeps/454</a>
            in which some of refinements confused me as follows:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <ol style="margin-top:0cm" type="1" start="1">
          <li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><i><span style="font-size:11.0pt">Enabled clients to build
                C-language function descriptors programmatically,
                avoiding platform-specific constants;<o:p></o:p></span></i></li>
          <li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><i><span style="font-size:11.0pt">Improved support for
                variable-length arrays in native memory;<o:p></o:p></span></i></li>
          <li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><i><span style="font-size:11.0pt">Added support for arbitrary
                charsets for native strings.<o:p></o:p></span></i></li>
        </ol>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I didn’t
            find any description in the JEP to clarify how they work and
            what they mean to users.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Could
            anybody explain these refinements in more details? Many
            thanks.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Best Regards<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Cheng<o:p></o:p></span></p>
      </div>
    </blockquote>
  </body>
</html>