ywkaras commented on code in PR #9183:
URL: https://github.com/apache/trafficserver/pull/9183#discussion_r1122252249
##########
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:
I prefer code that's less rather than more obscure. In any case, seems
misleading to say something is maybe unused when it's definitely unused.
We should never miss a chance to use a static_cast apparently.
It's dummy in the sense that we are reading a memory location as some sort
of fragile, ratchet, half-assed memory fence, rather than to read the value of
a memory location. Instead of using the more portable code I wrote to replace
this mess.
--
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]