Expose Vec capacity to C++
diff --git a/src/symbols/rust_vec.rs b/src/symbols/rust_vec.rs
index 4f4b6ff..6aa0b76 100644
--- a/src/symbols/rust_vec.rs
+++ b/src/symbols/rust_vec.rs
@@ -30,6 +30,12 @@
}
}
attr! {
+ #[export_name = concat!("cxxbridge1$rust_vec$", $segment, "$capacity")]
+ unsafe extern "C" fn __capacity(this: *const RustVec<$ty>) -> usize {
+ (*this).repr.capacity()
+ }
+ }
+ attr! {
#[export_name = concat!("cxxbridge1$rust_vec$", $segment, "$data")]
unsafe extern "C" fn __data(this: *const RustVec<$ty>) -> *const $ty {
(*this).repr.as_ptr()