<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>What version of jextract are you using? Addressable has been
dropped in Java 20.</p>
<p>I believe in the newer jextract all these will generate
MemorySegment types.</p>
<p>Now to your question:</p>
<blockquote type="cite" cite="mid:kRVw76vSCgQK7cFjvrS4_GBRluYTWrLDiQMklkvVxNAtCjZgBzpZQNYZPIVRYK5J96cSnOllBfcE3gxlTVsX06tphRbBUhUTVl8KTpl9qi0=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px;">
<ul>
<li><span>dynamically ask to an Addressable the type it
carries<br>
</span></li>
</ul>
</div>
</blockquote>
Not really - a memory segment is just a bag of bytes.<br>
<blockquote type="cite" cite="mid:kRVw76vSCgQK7cFjvrS4_GBRluYTWrLDiQMklkvVxNAtCjZgBzpZQNYZPIVRYK5J96cSnOllBfcE3gxlTVsX06tphRbBUhUTVl8KTpl9qi0=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px;">
<ul>
<li><span>ask JExtract to generate more precise types</span></li>
</ul>
</div>
</blockquote>
This is a possibility - e.g. jextract could add higher-level
carriers for structs and pointers. Note that here you don't really
want an array - when you use array syntax for a function declaration
in C, the compiler turns that into a pointer.<br>
<blockquote type="cite" cite="mid:kRVw76vSCgQK7cFjvrS4_GBRluYTWrLDiQMklkvVxNAtCjZgBzpZQNYZPIVRYK5J96cSnOllBfcE3gxlTVsX06tphRbBUhUTVl8KTpl9qi0=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px;">
<ul>
<li><span>if the idea of an Addressable<T> (rather than
simple Addressable) has been discussed and why it has not
been followed</span></li>
</ul>
</div>
</blockquote>
No, for the reason above, a memory segment is a bag of bytes. You
can freely dereference a memory segment as you please, reading any
combination of values. Adding typeful representation to segments is
an higher-level concern, presumably something jextract could add.<br>
<blockquote type="cite" cite="mid:kRVw76vSCgQK7cFjvrS4_GBRluYTWrLDiQMklkvVxNAtCjZgBzpZQNYZPIVRYK5J96cSnOllBfcE3gxlTVsX06tphRbBUhUTVl8KTpl9qi0=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;">In
the case of OpenGL, I can deal with it since there exists a
registry defining all functions with their typed parameters, so
I can generate the code able to make such conversion - but I
think that would be nice to get it out of the box with JExtract!</div>
</blockquote>
<p>It's something on our radar. Whatever solution we end up with, it
will have to balance carefully usability with performance - e.g.
if we add too much information, there might be an additional
overhead to create this representation, and not all jextract users
might be ok with that.</p>
<p>Cheers<br>
Maurizio<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:kRVw76vSCgQK7cFjvrS4_GBRluYTWrLDiQMklkvVxNAtCjZgBzpZQNYZPIVRYK5J96cSnOllBfcE3gxlTVsX06tphRbBUhUTVl8KTpl9qi0=@protonmail.com">
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;">Martin</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"> </div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;"><br>
</div>
<div class="protonmail_signature_block" style="font-family: Arial,
sans-serif; font-size: 14px;">
<div class="protonmail_signature_block-user
protonmail_signature_block-empty"> </div>
<div class="protonmail_signature_block-proton"> Envoyé avec la
messagerie sécurisée <a target="_blank" href="https://proton.me/" rel="noopener noreferrer" moz-do-not-send="true">Proton Mail</a>. </div>
</div>
</blockquote>
</body>
</html>