Kathryn-cat commented on code in PR #601: URL: https://github.com/apache/tvm-ffi/pull/601#discussion_r3358354827
########## include/tvm/ffi/reflection/accessor.h: ########## @@ -466,6 +466,27 @@ inline constexpr const char* kSHash = "__s_hash__"; * mapping; ``field_name`` is used for mismatch path reporting. */ inline constexpr const char* kSEqual = "__s_equal__"; +/*! + * \brief Custom structural visitor hook (used by ``StructuralVisitor``). + * + * The hook receives the active visitor and the current object value. Opaque + * pointer hooks return a ``TVMFFIAny`` that stores an + * ``Expected<Optional<VisitInterrupt>>`` result. + * + * Value type: either an opaque function pointer to a C++ structural visit hook Review Comment: This is the `__s_visit__` hook type signature, not the visitor vtable func ptr signature, so it should be `TVMFFIAny (*)(StructuralVisitorObj* visitor, const Object* value) noexcept`. `Object*` here is reasonable because only Object have reflected fields, not AnyView, and `Object*` is good for ABI-compatibility as we discussed. -- 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]
