Adding optional UUID to layouts

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Mar 24 11:44:15 UTC 2020


We're discussing to open up layout metadata API (which is currently 
restricted - you can only add layout names now). When that becomes a 
possibility I believe it would be possible for developers, or for 
clients such as jextract to decorate layouts more richly than what is 
being done now (which is the bare minimum). Since layout attributes play 
in the hashcode/equals dance, that means that similar layout (e.g. 32 
bits BE) with different attributes will NOT be considered equals (this 
is already the case e.g. if layouts have different names).

Maurizio

On 24/03/2020 11:01, Ty Young wrote:
> Hi,
>
>
> As was discussed before, I'm working on rigging up a dynamic memory 
> allocation API. I think I know how to go about it but I need an API 
> addition from Panama to make it happen since all interfaces are going 
> to be sealed.
>
>
> This addition comes in the form of a UUID which can be applied to any 
> given layout. A UUID, unlike a hashcode or a name, is not *intended* 
> to ever collide(hence UUID) with any other MemoryLayout.
>
>
> Currently both of those do: it's possible that variables or structs 
> (although, arguably uncommon) from different native libraries have the 
> same name and hashcode will return the same code given the same byte 
> size and ByteOrder.
>
>
> Could this be added?
>


More information about the panama-dev mailing list