You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a uint8_t* in C++ and I want to pass it into my rust code and use it as a Vec<u8>.
The current way I am doing it is converting the uint8_t* to a vector<uint8_t> in C++ and then passing it to rust as a vec: &CxxVector<u8>.
Then, I do let new_vec: Vec<u8> = vec.iter().cloned().collect(); to obtain a Vec<u8> in Rust.
This works fine but takes a long time since my vector is huge (~14GB) and I have to iterate through it and clone it.
I wonder if there is a way to pass the pointer directly into rust and cast it to a Vec<u8> in rust.
The text was updated successfully, but these errors were encountered:
Hi, I have a
uint8_t*
in C++ and I want to pass it into my rust code and use it as aVec<u8>
.The current way I am doing it is converting the
uint8_t*
to avector<uint8_t>
in C++ and then passing it to rust as avec: &CxxVector<u8>
.Then, I do
let new_vec: Vec<u8> = vec.iter().cloned().collect();
to obtain aVec<u8>
in Rust.This works fine but takes a long time since my vector is huge (~14GB) and I have to iterate through it and clone it.
I wonder if there is a way to pass the pointer directly into rust and cast it to a
Vec<u8>
in rust.The text was updated successfully, but these errors were encountered: