4 ms·
A historic mistake. These days a Java GC doesn't have to support pinning, and I don't think they do. Ctrl-F pinning at https://docs.oracle.com/javase/7/docs/t
by ErikCorry 4y ago
A historic mistake. These days a Java GC doesn't have to support pinning, and I don't think they do. Ctrl-F pinning at https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html https://docs.oracle.com/javase/7/docs/technotes/guides/jni/s...
- titzer 4y agoErg, but soon the Virgil GC will have to support pinning, because you can directly call the kernel to do I/O with on-heap byte arrays. Currently I get away with that because Virgil is single-threaded only, but that's gotta change for Wizard to compete with more advanced VMs.
- ErikCorry 4y agoMemcpy is fast. Don't let them pin your arrays.
- titzer 4y agoWith syscalls you can mmap the ethernet controller's DMA region and write directly to it; zero copy to the wire and back. In Virgil, there's literally no restriction on what Linux syscalls you can do, so why not that too. Though, Range<byte> of off-heap memory (a new Virgil feature implemented with fat pointers), is probably better; you don't even have to leave the memory-safe core language to manipulate off-heap data.
- ErikCorry 4y agoToit calls this external byte arrays, but whether it's a fat pointer or a small object is an implementation detail.