robo-corg commented on a change in pull request #8725:
URL: https://github.com/apache/tvm/pull/8725#discussion_r693104304



##########
File path: rust/tvm-rt/src/function.rs
##########
@@ -196,8 +204,8 @@ impl TryFrom<RetValue> for Function {
     }
 }
 
-impl<'a> From<Function> for ArgValue<'a> {
-    fn from(func: Function) -> ArgValue<'a> {
+impl<'a> From<&Function> for ArgValue<'a> {

Review comment:
       Function implements drop which looks like it frees the function? I think 
this needs a similar treatment as the other `From` impls.
   
   

##########
File path: rust/tvm-rt/src/ndarray.rs
##########
@@ -101,6 +101,21 @@ impl NDArrayContainer {
                 .cast::<NDArrayContainer>()
         }
     }
+
+    pub fn as_mut_ptr<'a>(object_ptr: &ObjectPtr<NDArrayContainer>) -> *mut 
NDArrayContainer

Review comment:
       This seems legit though some of the other functions on NDArrayContainer 
seem concerning from a rust memory model perspective.
   
   `pub fn leak<'a>(object_ptr: ObjectPtr<NDArrayContainer>) -> &'a mut 
NDArrayContainer` seems like it can be used to hand out multiple &mut 
NDArrayContainer and should be considered unsafe.




-- 
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-unsubscr...@tvm.apache.org

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


Reply via email to