khj809 commented on PR #348: URL: https://github.com/apache/tvm-ffi/pull/348#issuecomment-3685566975
@tqchen Thanks for the review. - About Index trait, the fn `index` requires to return the reference of output type, but it's technically impossible to return `&T` because `ArrayObj` does not store the buffer of `T` directly. Instead it's possible to return a reference of either `TVMFFIAny` or `AnyView`, so I implemented it to return `&AnyView` for now. - As you mentioned, I tried to use `AnyCompatible` instead of the previous `ObjectRefCore`. While doing this, I found the issue that `Any::into_raw_ffi_any` drops the data immediately and makes the array of objects having invalid data. Hence I added `ManuallyDrop` to prevent the destructor from running at the end of the scope. - As you mentioned, I removed all the mutable methods for now. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
