]> git.lttng.org Git - urcu.git/commit
Honor URCU_DEREFERENCE_USE_VOLATILE
authorOlivier Dion <odion@efficios.com>
Fri, 18 Oct 2024 15:41:11 +0000 (11:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 2 Dec 2024 18:19:03 +0000 (13:19 -0500)
commit4e87c71c3189841ac7fa223814ef0ef11d5dc9e9
tree1201521f5f3a95381dd417d49ea7477d1f512cb2
parentca62305c8956ae7c953c5f99be356a813c60265a
Honor URCU_DEREFERENCE_USE_VOLATILE

When users define `URCU_DEREFERENCE_USE_VOLATILE', `rcu_dereference()'
is implemented using `CMM_ACCESS_ONCE()', even when compiled with atomic
builtins or if the compiler support the C11 memory model.

This allows optimization on weakly-ordered architectures where the
`CMM_CONSUME' memory order is implemented as `CMM_ACQUIRE'.

To prevent the compiler from doing certain optimizations on pointers
equivalence, introduce the `cmm_ptr_eq()' API for pointer comparisons.

This also introduces the `_CMM_OPTIMIZER_HIDE_VAR()' private macro for
forcing the compiler optimizer to believe that a variable can be
manipulated arbitrarily, thus preventing optimizations based on pointer
equivalence.

Change-Id: Ib48c29370017990e6acf40a7590ab286a89691bd
Signed-off-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/urcu/compiler.h
include/urcu/static/pointer.h
This page took 0.02999 seconds and 4 git commands to generate.