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


##########
src/ffi/extra/buffer_stream.h:
##########
@@ -67,7 +69,7 @@ class BufferInStream {
   bool Read(T* data) {
     bool ret = Read(static_cast<void*>(data), sizeof(T)) == sizeof(T);  // 
NOLINT(*)
     if (!TVM_FFI_IO_NO_ENDIAN_SWAP) {
-      ByteSwap(&data, sizeof(T), 1);
+      ByteSwap(static_cast<void*>(&data), sizeof(T), 1);

Review Comment:
   Not sure if this `&` is desirable



##########
src/ffi/backtrace.cc:
##########
@@ -136,7 +136,7 @@ const TVMFFIByteArray* TVMFFIBacktrace(const char* 
filename, int lineno, const c
   // libbacktrace eats memory if run on multiple threads at the same time, so 
we guard against it
   if (tvm::ffi::_bt_state != nullptr) {
     static std::mutex m;
-    std::lock_guard<std::mutex> lock(m);
+    std::scoped_lock<std::mutex> lock(m);

Review Comment:
   Recommended by 
[`modernize-use-scoped-lock`](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-scoped-lock.html).
 Always replace `std::lock_guard` with `std::scoped_lock`



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