What we need to do IO in Julia with guaranteed memory safety

One thing is that reinterpret has to be aware of alignment and I think the redesign was chiefly meant to make it a safe and valid operation.

If you know that the alignment of your data is correct (maybe you have written the data from Julia) you could just use Mmap.mmap("filename", Vector{MyType}) instead of going through a Vector{UInt8} and then using reinterpret on that.

2 Likes