From 750a966c628f572bcf826b492e56f900972aa533 Mon Sep 17 00:00:00 2001 From: soruh Date: Sun, 13 Aug 2023 21:31:22 +0200 Subject: [PATCH] make FilePointer Send/Sync --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 95433e1..1839ddb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,13 +50,17 @@ type U64 = zerocopy::byteorder::U64; type U32 = zerocopy::byteorder::U32; type U16 = zerocopy::byteorder::U16; +// TODO: what is the correct PhantomData for this type #[derive(FromBytes, FromZeroes, AsBytes, Unaligned)] #[repr(transparent)] pub struct FilePointer { inner: RawFilePointer, - _phantom: PhantomData<*const T>, + _phantom: PhantomData, } +unsafe impl Send for FilePointer {} +unsafe impl Sync for FilePointer {} + impl Clone for FilePointer { fn clone(&self) -> Self { Self {