You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "SolidWallOfCode (via GitHub)" <gi...@apache.org> on 2023/03/01 19:40:53 UTC

[GitHub] [trafficserver] SolidWallOfCode commented on a diff in pull request #9183: TSAN fix for fake_global_for_ink_queue.

SolidWallOfCode commented on code in PR #9183:
URL: https://github.com/apache/trafficserver/pull/9183#discussion_r1122220143


##########
src/tscore/ink_queue.cc:
##########
@@ -94,6 +94,12 @@ static const ink_freelist_ops *default_ops = &freelist_ops;
 static ink_freelist_list *freelists                = nullptr;
 static const ink_freelist_ops *freelist_global_ops = default_ops;
 
+inline void
+dummy_forced_read(void *mem)
+{
+  static_cast<void>(*const_cast<int volatile *>(reinterpret_cast<int *>(mem)));

Review Comment:
   Use `[[maybe_unused]]` instead of `static_cast<void>()`?
   
   Also, you can `static_cast` to `int *` because it's a `void *`.
   
   Finally, `force_read` might be a better name. There's no longer a dummy variable involved



-- 
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: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org