4 ms·
You can do manual memory allocation in Java using the "unsafe" API. It's relatively common in high performance libraries. There are actually three implementati
by sievebrain 11y ago
You can do manual memory allocation in Java using the "unsafe" API. It's relatively common in high performance libraries.
There are actually three implementations of C on top of Graal/Truffle by now.
TruffleC was the first and it maps malloc to the JVM's Unsafe malloc equivalent. So if you double free you trash the VM basically.
ManagedC ignores calls to free() and garbage collects the C programs heap.
Sulong interprets LLVM bytecode. I don't know how it does memory management.