Commit c843ec0d authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'leak_checker' into 'master'

fix EventLoop LeakCheck unit test ATLASG-1610

See merge request atlas/athena!48168
parents a54106a2 a7f67239
......@@ -19,7 +19,12 @@ namespace EL {
// Allocate the requested amount of memory.
if( m_leakBytes > 0 ) {
char* lostPointer = new char[ m_leakBytes ];
// This needs to be `volatile` and zeroed out to ensure the memory
// really gets allocated by the operating system. Without `volatile`
// the compiler is essentially allowed to optimize away the write,
// and the operating system isn't required to allocate it if it isn't
// written to.
volatile char* lostPointer = new volatile char[ m_leakBytes ];
for( int i = 0; i < m_leakBytes; ++i ) {
*lostPointer = 0;
++lostPointer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment