RFR: 8237521: Memory Access API fixes for 32-bit

Andrew Haley aph at redhat.com
Thu Jan 23 14:41:39 UTC 2020

On 1/23/20 10:22 AM, David Holmes wrote:
> That aside IIRC the overflow check is not ideal here because we already 
> enter undefined behaviour territory inside align_up if we actually 
> overflow.

How is that possible? size_t is an unsigned type, and unsigned types
never overflow. On a 32-bit box, 0 <= size < 2**32. So -- in theory at
least -- you could allocate more than 2G.

Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-runtime-dev mailing list