make FilePointer Send/Sync

This commit is contained in:
soruh 2023-08-13 21:31:22 +02:00
parent f3915db754
commit 750a966c62

View File

@ -50,13 +50,17 @@ type U64 = zerocopy::byteorder::U64<LE>;
type U32 = zerocopy::byteorder::U32<LE>; type U32 = zerocopy::byteorder::U32<LE>;
type U16 = zerocopy::byteorder::U16<LE>; type U16 = zerocopy::byteorder::U16<LE>;
// TODO: what is the correct PhantomData for this type
#[derive(FromBytes, FromZeroes, AsBytes, Unaligned)] #[derive(FromBytes, FromZeroes, AsBytes, Unaligned)]
#[repr(transparent)] #[repr(transparent)]
pub struct FilePointer<T> { pub struct FilePointer<T> {
inner: RawFilePointer, inner: RawFilePointer,
_phantom: PhantomData<*const T>, _phantom: PhantomData<T>,
} }
unsafe impl<T> Send for FilePointer<T> {}
unsafe impl<T> Sync for FilePointer<T> {}
impl<T> Clone for FilePointer<T> { impl<T> Clone for FilePointer<T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Self { Self {