You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/08/19 17:34:50 UTC

[GitHub] [tvm] jroesch opened a new issue #8800: [Rust] Fix ByteArray conversion to TVMRetValue from Rust.

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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org