Earlier quoted context omitted.
I think with regular old java this would be impossible to do in a reasonable way. But with AOT compiled Java and extensions like @Uninterruptible you can do it. I think I'd phrase it like this: you can write a GC mostly in Java. Other GCs than the default Java one in native image like G1 actually embed the C++ version of the implementation instead of writing it in Java.
> But with AOT compiled Java and extensions like @Uninterruptible you can do it. Yeah, but also the code shown above used native low level primitives like mmap which typically aren't available. AOT, special behavior directives (@Uninterruptible), native memory access, making sure not to use new (?), at that point you are formally using Java, the language, but it's sort of its own thing. So, that's still cool and like…
Native calls are a normal part of Java. And the pointer and word classes used could be implemented using the Unsafe class which is present in Java.