From: Olivier Dion Date: Thu, 21 Nov 2024 16:54:55 +0000 (-0500) Subject: Document cmm_cast_volatile X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=031ece570138435e3438166ee49b13b574bce25a;p=userspace-rcu.git Document cmm_cast_volatile Change-Id: I3ce8df69a967b3bdaf940c4db06fd775e5b9eccb Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- diff --git a/include/urcu/compiler.h b/include/urcu/compiler.h index 6254252..e027c13 100644 --- a/include/urcu/compiler.h +++ b/include/urcu/compiler.h @@ -193,6 +193,13 @@ /* * Helper to add the volatile qualifier to a pointer. + * + * This is used to enforce volatile accesses even when using atomic + * builtins. Indeed, C11 atomic operations all work on volatile memory + * accesses, but this is not documented for compiler atomic builtins. + * + * This could prevent certain classes of optimization from the compiler such + * as load/store fusing. */ #if defined __cplusplus template