[foreign-memaccess] RFR 8228487: Find a better name for MemoryLayout::ofValue
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jul 22 17:56:40 UTC 2019
Whoops - just realized that the pad constants are constructed the wrong
way (they always use size 8). This problem predates this patch, but I've
addressed it in the webrev below:
http://cr.openjdk.java.net/~mcimadamore/panama/8228487_v2
Maurizio
On 22/07/2019 18:53, Maurizio Cimadamore wrote:
> Hi,
> this is a simple (but probably controversial) patch. I realized that
> when we consolidated all the factories for ValueLayout we were left
> with a very general-sounding:
>
> MemoryLayout.ofValue(32, ....)
>
> This kind of gives the feeling that 32 is the _value_, not the size in
> bits.
>
> This patch changes that to 'ofValueBits' and does a similar change
> ofPadding -> ofPaddingBits
>
> (leaving the door open to ofValueBytes and ofPaddingBytes).
>
> I've also considered MemoryLayout.ofBits as an alternative, but found
> it too vague (after all, even padding is "bits").
>
> I think I like ofValueBits/ofPaddingBits, but these factory names are
> now slightly inconsistent with the constant names in MemoryLayouts -
> can we live with that? Or do we need better constant names too?
>
> Webrev:
>
> http://cr.openjdk.java.net/~mcimadamore/panama/8228487/
>
> Maurizio
>
More information about the panama-dev
mailing list