Commit 00e87f96 authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch 'cherry-pick-c843ec0d-21.2' into '21.2'

Sweeping !48168 from master to 21.2.
fix EventLoop LeakCheck unit test ATLASG-1610

See merge request atlas/athena!48187
parents 0b7fd840 64005bef
......@@ -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