Closed sebcrozet closed 1 year ago
Well it's expected if the buffer isn't aligned for an f64.
I've got no idea what the minimum alignment of mmap is on Windows vs Linux, but perhaps Linux guarantees a higher alignment minimum.
We could try looking at the raw pointer that we get from the mmap and see if it has the expected alignment.
yeah, and try_cast_slice
is available if there's any risk of insufficient alignment.
It looks like mmap
on an empty file is giving an address equal to 0x01
:
Mmap { ptr: 0x1, len: 0 }
Let’s close this then, that’s not an issue in bytemuck
. Thanks!
I have this test which creates an empty temporary file, memory-maps it, and cast it to a
&[f64]
:While it works fine on Linux, it fails on Windows with the following error:
Is that the expected behavior?