RFR: JDK-8205549 JDK-8205698 Support of flattened values in Unsafe
John Rose
john.r.rose at oracle.com
Fri Jun 29 21:13:08 UTC 2018
On Jun 29, 2018, at 1:51 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>
> It’s a similar problem to the writing of final fields. Since it's possible peek and poke at any memory location with Unsafe with byte to longs and now to compound values in a single call i am unsure how we can, in general, enforce immutability or stop word tearing. Unsafe accesses can break the integrity of the VM in many ways.
>
> Such enforcement is easier if performed by the caller. Perhaps there are ways to define a set of ranges over which an offset+length is valid for writes to a base Object but that requires bounds checking and this is the kind of checking that is currently performed by the caller (and it will not be enforced for off-heap access to the same memory addresses as the base Object).
+1
BYOSB (bring your own seat belts)
More information about the valhalla-dev
mailing list