From 27420fbda3ae36f5403ecfd43b33061df6249df8 Mon Sep 17 00:00:00 2001 From: Sven Stork Date: Fri, 3 Nov 2006 10:46:18 +0000 Subject: [PATCH] - Make counter volatile to prohibit compiler to perform optimisations. Without this a compiler could assume that the counter is not updated my the malloc call and remove the test in the assert and always trigger the assertion. This commit was SVN r12419. --- test/memory/opal_memory_basic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/memory/opal_memory_basic.c b/test/memory/opal_memory_basic.c index 72334168d8..d7f7fefd83 100644 --- a/test/memory/opal_memory_basic.c +++ b/test/memory/opal_memory_basic.c @@ -27,7 +27,7 @@ #include "opal/runtime/opal.h" #include "opal/memoryhooks/memory.h" -int counter = 0; +volatile int counter = 0; const int bigsize = 100 * 1024 * 1024; static void