junrushao commented on code in PR #593:
URL: https://github.com/apache/tvm-ffi/pull/593#discussion_r3581371056
##########
python/tvm_ffi/cython/object.pxi:
##########
@@ -432,6 +440,19 @@ cdef inline object make_ret_opaque_object(TVMFFIAny
result):
(<CObject>obj).chandle = result.v_obj
return obj.pyobject()
+cdef public void** TVMFFICyObjectGetCHandlePtr(PyObject* ptr) noexcept:
+ # Address of a CObject wrapper's ``chandle`` field, for the C++ helpers.
+ return &((<CObject>ptr).chandle)
+
+
+cdef inline void _install_pyobject_tying_slots(object type_cls):
+ """Install the custom tp_alloc / tp_free PyObject-tying slots on a
+ registered FFI type. No-op unless ``type_cls`` is a ``CObject`` subclass.
+ """
+ if type_cls is not None and isinstance(type_cls, type) and
issubclass(type_cls, CObject):
+ TVMFFIPyInstallTypeSlots(<PyObject*>type_cls)
Review Comment:
inline this method - it's used only once
--
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]