From 9cf5b3709cd2ae96bb3f7c09cd13d7b554064b08 Mon Sep 17 00:00:00 2001 From: Sven Stork Date: Mon, 6 Nov 2006 14:00:43 +0000 Subject: [PATCH] - Add comment for volatile. This commit was SVN r12436. --- test/memory/opal_memory_basic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/memory/opal_memory_basic.c b/test/memory/opal_memory_basic.c index d7f7fefd83..6421c8d180 100644 --- a/test/memory/opal_memory_basic.c +++ b/test/memory/opal_memory_basic.c @@ -27,6 +27,10 @@ #include "opal/runtime/opal.h" #include "opal/memoryhooks/memory.h" +/* + * The counter variable is volatile to avoid (wrong) compiler optimisations, + * which can lead to wrong code. + */ volatile int counter = 0; const int bigsize = 100 * 1024 * 1024;