More detail than I had intended on Layout description language.
David Chase
david.r.chase at oracle.com
Tue Nov 18 23:28:35 UTC 2014
On 2014-11-18, at 5:31 PM, Angela Lin <angela_lin at ca.ibm.com> wrote:
>
> Some aspects I'd like to highlight from Tobi's email:
>
> 1. LDL/NFD, by default, should describe exact memory layout on the
> execution platform. In particular:
> - Fields must have explicitly specified width. So, if the LDL/NFD models a
> C struct that contains a void*, the size of the void* has to be known
> up-front.
> - No automatic padding or alignment.
> - Fields either have explicitly specified offset, or are laid out in the
> order of specification.
> - Native endian.
>
> This implies that the descriptor for, say, a C struct, may not be portable
> across all platforms. If the descriptor models a data structure that is
> shared with a native library, then the descriptor is tied to the particular
> native library binary. I think this is consistent with David's earlier
> statement:
>> So, since the Java-side behavior should be different, I think that
>> the little language inputs
>> (the output of the libclang-based tool) should be different
>> depending on platform ? the
>> offsets will need to be described in ways that make conform to
>> Java?s expectations.
I think what you are saying is consistent, but I didn’t get that from Tobi’s email,
so I’ll reread it more carefully. The language surrounding “pointer” in particular
made me think that he was approaching it differently.
Was I correct in seeing that it is proposed to attach LDL to interfaces with annotations?
My snap reaction is that’s a good idea, even if it does perhaps push the LDL back into text.
And I think (based on discussions at this end) that being able to treat these
things as native-resident references is priority #1, but I’m not sure that the only
priority.
But I will look again. (A bug with a deadline is currently grabbing most of my
attention, unfortunately).
Also, I think we might need alignment specification, especially considering possible
GPU applications. It’s not necessarily for padding purposes, but it is required to ensure
that memory is properly allocated and placed — for example, can I allocate a 64-bit quantity
on an 8-bit boundary? How am I told that I cannot do this?
David
More information about the panama-spec-experts
mailing list