Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Added Send+Sync to MutableBuffer #368

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,8 @@ impl MutableBuffer<u8> {
MutableBuffer::from_trusted_len_iter_unchecked(iter).into()
}
}

// This is sound because `NativeType` is `Send+Sync`, and
// `MutableBuffer` has the invariants of `Vec<T>` (which is `Send+Sync`)
unsafe impl<T: NativeType> Send for MutableBuffer<T> {}
unsafe impl<T: NativeType> Sync for MutableBuffer<T> {}