Skip to content

Commit a3214b4

Browse files
authored
Merge pull request #54 from qorix-group/pawelrutkaq_make_heap_send
Make Heap<T> be Send for T:Send
2 parents b3210fd + 7a6acb9 commit a3214b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/containers/storage/heap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pub struct Heap<T> {
3232
_marker: PhantomData<T>,
3333
}
3434

35+
// SAFETY: `Heap<T>` can be sent to another thread if `T` can be sent to another thread. It's because we use system allocation which is send-safe.
36+
unsafe impl<T: Send> Send for Heap<T> {}
37+
3538
impl<T> Heap<T> {
3639
fn layout(capacity: u32) -> Option<Layout> {
3740
(capacity as usize)

0 commit comments

Comments
 (0)