junrushao commented on code in PR #58:
URL: https://github.com/apache/tvm-ffi/pull/58#discussion_r2380686199


##########
include/tvm/ffi/c_api.h:
##########
@@ -224,12 +224,18 @@ typedef struct {
   // ABI note: Strong ref counter and weak ref counter can be packed into a 
single 64-bit field
   // Hopefully in future being able to use 64bit atomic that avoids extra 
reading of
   // weak counter during deletion.
-  /*! \brief Strong reference counter of the object. */
-  uint32_t strong_ref_count;
   /*!
-   * \brief Weak reference counter of the object, for compatiblity with 
weak_ptr design.
+   * \brief Combined strong and weak reference counter of the object.
+   *
+   * Strong ref counter is packed into the lower 32 bits.
+   * Weak ref counter is packed into the upper 32 bits.
+   *
+   * It is equivalent to { uint32_t strong_ref_count, uint32_t weak_ref_count }
+   * in little-endian structure.

Review Comment:
   ditto. lower/upper may depend on endian which is vague, bit ops are more 
well-defined



-- 
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]

Reply via email to