<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi Jorn,</div>
<div> </div>
<div>Thank you, we will include reference to these details into documentation.</div>
<div>
<div>Regards,
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Thursday, February 27, 2025 at 3:58 PM<br/>
<b>From:</b> "Jorn Vernee" <jorn.vernee@oracle.com><br/>
<b>To:</b> "Lain Lain" <lain@null.net>, jextract-dev@openjdk.org<br/>
<b>Subject:</b> Re: ffmbindings manual bindings to C++</div>
<div name="quoted-content">
<p>Hello,</p>
<p>I had a quick look, and just want to note about the difference between the result of `sizeof` and `MemoryLayout::byteSize`. From what I've seen, compilers typically pad out the end of a struct so that it can be aligned when placed in an array, and this can be observed when using PAHole, or the MSVC debugging flags. i.e. this seems to be more than just a quirk of the sizeof operator. If you want the same result using the layout API, you have to add this trailing padding:</p>
<pre> MemoryLayout.structLayout(
ValueLayout.JAVA_DOUBLE.withName("d1_"),
ValueLayout.JAVA_DOUBLE.withName("d2_"),
ValueLayout.JAVA_INT.withName("type_"),
MemoryLayout.paddingLayout(4));</pre>
<p>Jorn</p>
<div class="moz-cite-prefix">On 26-2-2025 03:13, Lain Lain wrote:</div>
<blockquote>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hi,</div>
<div>We would like to present you ffmbindings project which helps to do manual bindings to C++ libraries from Java using FFM.</div>
<div>Currently it contains bindings to eigen C++ library but we are going to publish few more this month.</div>
<div> </div>
<div>Source code: <a class="moz-txt-link-freetext" href="https://bitbucket.org/ffmbindings" target="_blank">https://bitbucket.org/ffmbindings</a><br/>
Documentation: <a class="moz-txt-link-freetext" href="https://ffmbindings.onrender.com" target="_blank">https://ffmbindings.onrender.com</a></div>
<div> </div>
<div>Any feedback are welcome.</div>
<div> </div>
<div>Thank you,</div>
</div>
</blockquote>
</div>
</div>
</div>
</div></div></body></html>