On Thu, 10 Sep 2026 06:03:02 GMT, Yasumasa Suenaga <[email protected]> wrote:
> Can you show example how can I create them?
1. Null-restricted flat field without a null marker case:
value class Point { int x, y;}
class XXX { Point! point; // null-free; eligible for flat storage without a
null marker
}
2. Non-flattened heap value object case:
Non-flattened heap value object is simply a value object stored as a normal
object reference, e.g.:
static Object o; // ref-typed storage prevents flattening
public static void main(String[] args) {
Point p = new Point(1, 2);
o = p; // heap value object is reachable through Object
System.out.println(o);
}
-------------
PR Comment: https://git.openjdk.org/jdk/pull/32310#issuecomment-5614467663