Skip to content
Open
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
3 changes: 3 additions & 0 deletions score/containers_rust/storage/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ pub struct Heap<T, A: BasicAllocator> {
// SAFETY: `Heap<T>` can be sent to another thread if `T` can be sent to another thread and used allocator is send-safe.
unsafe impl<T: Send, A: BasicAllocator + Send> Send for Heap<T, A> {}

// SAFETY: `Heap<T>` can be shared across threads if `T` can be shared across threads and the used allocator is share-safe.
unsafe impl<T: Sync, A: BasicAllocator + Sync> Sync for Heap<T, A> {}

impl<T, A: BasicAllocator> Heap<T, A> {
fn layout(capacity: u32) -> Option<Layout> {
(capacity as usize)
Expand Down
Loading