MemoryLayout api

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Jan 21 17:36:10 UTC 2020


On 21/01/2020 15:17, Remi Forax wrote:
> Hi all,
> i've played a little bit with the current version used by the jdk 15 and the one in the branch foreign-memaccess (for the benchmarks).
>
> I really like the API, the MemoryLayout part in particular.
>
> I will do a presentation in two weeks about the foreign API (and everythings else introduced in jdk 14)
>    https://github.com/forax/do-synthetic-methods-dream-of-electric-switch-expressions
> All my tests are available as a python notebook (see the README).

Nice tests :-)

I'm happy that you are getting relatively decent numbers, considering 
the number of C2 potholes we are currently working around.

One question - do all your ByteBuffer benchmarks use 
Unsafe.invokeCleaner() ?


Maurizio


>
> There is something i don't understand.
> The memory layout API let you create layouts that are invalid, i.e. that you can not create any VarHandle on it,
> by example a group (struct or union) that contains a sequence without a size, or a layout that starts with two sequences with no size.
>
> I get why you can have one sequence free, but you can not have more than one, otherwise you can not compute the size of the inner layout.
>
> So why the layout API let users create such badly shaped layout ?
> May i have overlooked something ?
>
> regards,
> Rémi
>
>


More information about the panama-dev mailing list