News for hackers. Stuff that matters.
Re:Treadmill garbage collector by H. Baker by ErikCorry on Tuesday July 26, 2022 @04:38AM (#32235799)
The Java link doesn't describe a way to have a pointer to a subobject. In Java you must always point at the start of an object.

In Go, objects are segregated by allocation size, so the GC can round subobject pointers to keep the surrounding object alive.

Re:Treadmill garbage collector by H. Baker by aardvark179 on Tuesday July 26, 2022 @05:10AM (#32235974)
Although it isn't visible from the language level the JVM internally does have "derived pointers" which are normally stored on the stack and point to an offset within an object. The GC can figure this out because it has a map for what the stack entries mean.
Re:Treadmill garbage collector by H. Baker by moonchild on Tuesday July 26, 2022 @06:34AM (#32236489)
'The' JVM can internally have whatever it likes; so long as it is not exposed at the language level, nothing prevents an implementation from being devised which does not have such things internally, and which has a treadmill.
Re:Treadmill garbage collector by H. Baker by pjmlp on Tuesday July 26, 2022 @07:02AM (#32236679)
JNI and Unsafe also exist, it isn't only about the language alone.
Re:Treadmill garbage collector by H. Baker by ErikCorry on Tuesday July 26, 2022 @07:23AM (#32236829)
Oh cool, I didn't realize the stack maps were so advanced. Now I'm trying to imagine which optimizations made this necessary/useful.