3 ms·
Memcpy is fast. Don't let them pin your arrays.
by ErikCorry 4y ago
Memcpy 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.