Skip to content

Commit

Permalink
feat: impl Clone for MemoryInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Oct 18, 2024
1 parent b0e7ebe commit d0ee395
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ impl MemoryInfo {
}
}

impl Clone for MemoryInfo {
fn clone(&self) -> Self {
MemoryInfo::new(self.allocation_device(), self.device_id(), self.allocator_type(), self.memory_type()).expect("failed to clone memory info")
}
}

impl PartialEq<MemoryInfo> for MemoryInfo {
fn eq(&self, other: &MemoryInfo) -> bool {
let mut out = 0;
Expand Down

0 comments on commit d0ee395

Please sign in to comment.