From 031ece570138435e3438166ee49b13b574bce25a Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Thu, 21 Nov 2024 11:54:55 -0500 Subject: [PATCH] Document cmm_cast_volatile Change-Id: I3ce8df69a967b3bdaf940c4db06fd775e5b9eccb Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- include/urcu/compiler.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.39.5