[foreign-memaccess] RFR 8228487: Find a better name for MemoryLayout::ofValue

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Jul 23 13:24:41 UTC 2019


Thanks, pushed (we can as usual, revise naming later for fine tuning).

I also took the chance to fix some of the javadoc code examples which 
went out of sync following some of the recent renames.

Maurizio

On 23/07/2019 03:59, Sundararajan Athijegannathan wrote:
> 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