<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<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<br>
</p>
<div class="moz-cite-prefix">On 26-2-2025 03:13, Lain Lain wrote:<br>
</div>
<blockquote type="cite" cite="mid:trinity-1f62d70a-15ac-45e2-be8d-7cf11deba548-1740535984984@3c-app-mailcom-lxa06">
<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">https://bitbucket.org/ffmbindings</a><br>
Documentation: <a class="moz-txt-link-freetext" href="https://ffmbindings.onrender.com">https://ffmbindings.onrender.com</a></div>
<div> </div>
<div>Any feedback are welcome.</div>
<div> </div>
<div>Thank you,</div>
</div>
</blockquote>
</body>
</html>