[foreign-memaccess] RFR 8228487: Find a better name for MemoryLayout::ofValue
Sundararajan Athijegannathan
sundararajan.athijegannathan at oracle.com
Tue Jul 23 02:59:14 UTC 2019
Looks good.
of<Value/Padding>Bits reads fine.
-Sundar
On 22/07/19, 11:26 PM, Maurizio Cimadamore wrote:
> 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