summaryrefslogtreecommitdiff
path: root/rust/src/databuffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/databuffer.rs')
-rw-r--r--rust/src/databuffer.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/src/databuffer.rs b/rust/src/databuffer.rs
index d660f570..2d8af7eb 100644
--- a/rust/src/databuffer.rs
+++ b/rust/src/databuffer.rs
@@ -17,8 +17,6 @@ use binaryninjacore_sys::*;
use std::ptr;
use std::slice;
-// TODO : DataBuffers are RefCounted objects, this needs to be changed to only return Refs to DataBuffers
-
pub struct DataBuffer(*mut BNDataBuffer);
impl DataBuffer {
@@ -69,3 +67,9 @@ impl Drop for DataBuffer {
}
}
}
+
+impl Clone for DataBuffer {
+ fn clone(&self) -> Self {
+ Self::from_raw(unsafe { BNDuplicateDataBuffer(self.0) })
+ }
+}