News for hackers. Stuff that matters.
Re:Java’s new garbage collector promises low pause times on ... by blt on Thursday August 30, 2018 @02:01PM (#17879045)
Moreover, they can be used in composite objects without pointer chasing. Suppose class A is a 32-byte value type. Then

    class B {
        A a1;
        A a2;
    }
is one continuous 64-byte block of memory. Without value types, each A will be allocated separately on the heap, and B will be a pair of pointers.

Lack of value types makes it hard to get cache efficient memory layouts in Java.

Re:Java’s new garbage collector promises low pause times on ... by trhway on Thursday August 30, 2018 @03:48PM (#17880106)
Of course if/when a1 gets also referenced from outside while you may not need B any more that is then the things become more interesting.
Re:Java’s new garbage collector promises low pause times on ... by londons_explore on Thursday August 30, 2018 @05:09PM (#17880804)
Depends how they implement value types. They might simply say 'you can't have a reference to a value type'. You either embed it in your class, or you copy it's value.