<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 12/03/2025 16:25, Brian Goetz wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:da776b1e-7ef8-417c-9238-5d55e452a254@oracle.com">
      
      <font size="4" face="monospace">That does seem like a more
        future-proof choice.  (I suspect too it would be less intrusive
        to adapt the internals to MS than BB.)</font><br>
    </blockquote>
    <p><font size="4" face="monospace">They are probably similar in
        spirit -- but at least you would know that the MS path is more
        aggressively/actively optimized.</font></p>
    <p><font size="4" face="monospace">I do share some of Chen's
        concerns -- random access on MS (and BB) is not comparable to
        random access on a byte[]. So changing the internals of the
        classfile API to use MS/BB is something that needs to be done
        carefully (and with benchmarks at hands).</font></p>
    <p><font size="4" face="monospace">One possible area where adopting
        a "more raw" buffer would be beneficial is when writing/reading
        custom attributes -- since BB/MS will already provide the
        primitives we need to access load/store primitive values from/in
        the buffer. But -- again, something that requires care and
        consideration, it's not a slam dunk.<br>
      </font></p>
    <p><font size="4" face="monospace">Maurizio<br>
      </font></p>
    <blockquote type="cite" cite="mid:da776b1e-7ef8-417c-9238-5d55e452a254@oracle.com"> <br>
      <div class="moz-cite-prefix">On 3/12/2025 11:53 AM, Maurizio
        Cimadamore wrote:<br>
      </div>
      <blockquote type="cite" cite="mid:16a12929-7ba7-417c-a8f4-aa0f04e5e11e@oracle.com"> <br>
        On 10/03/2025 17:52, Brian Goetz wrote: <br>
        <blockquote type="cite">My first reaction is that the first
          seems fine in theory <br>
        </blockquote>
        <br>
        I wonder if an API accepting a MemorySegment would be more
        general -- you can construct a MS from a BB and you can of
        course go from MS to byte[] (which is what the impl needs). So I
        wonder if that would be more future-proof. (We can, of course,
        also provide both). <br>
        <br>
        Maurizio <br>
        <br>
      </blockquote>
      <br>
    </blockquote>
  </body>
</html>