jroesch opened a new issue #8800:
URL: https://github.com/apache/tvm/issues/8800


   Currently we have an ownership issue when returning `ByteArray` from Rust to 
C++. We do not know where the `*TVMByteArray` pointer has been allocated from 
(i.e Rust's global allocator, or malloc) leading to incorrect frees. This is 
not blocking most use cases of the Rust bindings so I am opening a tracking 
issue to follow up on this. 
   
   ```
    // Follow up with ByteArray RetValue ownership.
    #[test]
       fn bytearray() {
           let w = vec![1u8, 2, 3, 4, 5];
           let v = ByteArray::from(w.as_slice());
           let tvm: ByteArray = RetValue::from(v).try_into().unwrap();
           assert_eq!(
               tvm.data(),
               w.iter().copied().collect::<Vec<u8>>().as_slice()
           );
       }
    ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to