Serialize/deserialize structs through MemorySegment ofByteBuffer/toByteArray
The specialized functions for mass loading arrays into native memory seem to be much faster than iterative copying from scala to C via memoryaccess. It may then behoove us to serialize/deserialize structs into bytebuffers/arrays and use ofByteBuffer/toByteArray to copy data into/out of foreign memory.