From 1cf38945621be1bd2ce46890fb512590bb74e4b8 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 5 Mar 2019 17:05:47 +0100 Subject: [PATCH] Add Sync+Send to Allocation and AllocationInfo. They do not have any mutable functions so should be safe. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5405d4f..4e2a3ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -69,6 +69,9 @@ pub struct Allocation { pub(crate) internal: ffi::VmaAllocation, } +unsafe impl Send for Allocation {} +unsafe impl Sync for Allocation {} + /// Parameters of `Allocation` objects, that can be retrieved using `Allocator::get_allocation_info`. #[derive(Debug, Clone)] pub struct AllocationInfo { @@ -76,6 +79,9 @@ pub struct AllocationInfo { pub(crate) internal: ffi::VmaAllocationInfo, } +unsafe impl Send for AllocationInfo {} +unsafe impl Sync for AllocationInfo {} + impl AllocationInfo { #[inline(always)] // Gets the memory type index that this allocation was allocated from. (Never changes)