ATLAS Offline Software
Loading...
Searching...
No Matches
PerfMonTestManyLeaksAlg.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// PerfMonTestManyLeaksAlg.h
8// Header file for class PerfMonTest::ManyLeaksAlg
9// Author: R.Sesuter
11#ifndef PERFMONTESTS_PERFMONTESTMANYLEAKSALG_H
12#define PERFMONTESTS_PERFMONTESTMANYLEAKSALG_H
13
14// STL includes
15#include <string>
16#include <list>
17#include <vector>
18
19
20// FrameWork includes
23
24namespace PerfMonTest {
25
27{
28 public:
31
32 // Athena algorithm's Hooks
33 virtual StatusCode initialize() override;
34 virtual StatusCode execute() override;
35
36 private:
37
38 long* stillReachableFct(long** array);
39
41 long* possibleLostFct(long** array);
42
44 long* indirectlyLostFct(long** array);
45
47 long* definitelyLostFct(long** array);
48
50 void leakAll();
51
53 Gaudi::Property<int> m_leakSize{this, "LeakSize", 10, "Number of longs to be leaked just once"};
54
56 Gaudi::Property<bool> m_leakInInit{this, "LeakInInit", false, "Where it will leak: initialize or execute(default)"};
57
58 private:
59
60 // this one's still reachable
62
63 // this one's possible lost
65
66 // this one's indirectly lost
68
69 // this one's definitely lost
71
72 // we still need to reference some pointers,
73 // otherwise vagrind labels everything definitely lost
74 static long **m_pointers ATLAS_THREAD_SAFE;
75};
76
77} //> end namespace PerfMonTest
78
79#endif //> PERFMONTESTS_PERFMONTESTMANYLEAKSALG_H
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
static long **m_pointers ATLAS_THREAD_SAFE
void leakAll()
this one's definitely lost
Gaudi::Property< int > m_leakSize
Property to setup the size of the leak.
long * possibleLostFct(long **array)
this one's possible lost
Gaudi::Property< bool > m_leakInInit
Property to setup the location of the leak, in initialize (true) or execute (false)
long * indirectlyLostFct(long **array)
this one's indirectly lost
long * definitelyLostFct(long **array)
this one's definitely lost
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor:
virtual StatusCode execute() override
virtual StatusCode initialize() override
PerfMonTestPolyVectorAlg.h Example for the memory optimization tutorial.