RFR (M): 8184334: Generalizing Atomic with templates
kim.barrett at oracle.com
Fri Jul 21 00:24:46 UTC 2017
> On Jul 17, 2017, at 11:59 AM, Andrew Haley <aph at redhat.com> wrote:
>> So for example, we need to be able to perform the following conversions:
>> 1) Floating point to integer without changing bit representaiton. It
>> seems like the only way of doing this without violating the C++03
>> standard is to use memcpy. (no, the union trick in e.g. jfloat_cast is
>> not standards compliant)
> I'm not entirely convinced that memcpy does it either for "truly
> portable" C++, but perhaps it's as good as we're going to get.
See 3.9, where it talks about using memcpy to copy the "value
representation". That dodges the 3.10/15 restrictions by not
accessing the stored value through an lvalue.
More information about the hotspot-runtime-dev