ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
PerformanceMonitoring
PerfMonTests
src
PerfMonTestLeakyAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// PerfMonTestLeakyAlg.cxx
6
// Implementation file for class PerfMonTest::LeakyAlg
7
// Author: S.Binet<binet@cern.ch>
9
10
11
// STL includes
12
13
// FrameWork includes
14
#include "Gaudi/Property.h"
15
16
// PerfMonTests includes
17
#include "
PerfMonTestLeakyAlg.h
"
18
19
using namespace
PerfMonTest
;
20
21
22
// Destructor
24
LeakyAlg::~LeakyAlg
()
25
{
26
ATH_MSG_DEBUG
(
"Calling destructor"
) ;
27
// finally deleting our leaked objects...
28
for
( std::list<Leak*>::iterator i =
m_leaks
.begin(), iEnd =
m_leaks
.end();
29
i != iEnd;
30
++i ) {
31
delete
*i; *i = 0;
32
}
33
}
34
35
// Athena Algorithm's Hooks
37
StatusCode
LeakyAlg::initialize
()
38
{
39
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
) ;
40
41
// Get pointer to StoreGateSvc and cache it :
42
ATH_CHECK
(
evtStore
().retrieve() );
43
44
return
StatusCode::SUCCESS;
45
}
46
47
48
StatusCode
LeakyAlg::execute
(
const
EventContext&
/*ctx*/
)
49
{
50
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
) ;
51
52
if
( 0 ==
m_leakSize
) {
53
return
StatusCode::SUCCESS;
54
}
55
56
for
(
int
ileak = 0; ileak <
m_nbrLeaks
; ++ileak) {
57
Leak
* leak =
new
Leak
;
58
leak->
m_data
.reserve(
m_leakSize
);
59
for
( std::size_t i = 0; i !=
static_cast<
std::size_t
>
(
m_leakSize
); ++i ) {
60
leak->
m_data
.push_back( i );
61
}
62
63
m_leaks
.push_back( leak );
64
}
65
66
return
StatusCode::SUCCESS;
67
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PerfMonTestLeakyAlg.h
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
PerfMonTest::LeakyAlg::initialize
virtual StatusCode initialize() override
Definition
PerfMonTestLeakyAlg.cxx:37
PerfMonTest::LeakyAlg::m_nbrLeaks
Gaudi::Property< int > m_nbrLeaks
nbr of Leak objects
Definition
PerfMonTestLeakyAlg.h:56
PerfMonTest::LeakyAlg::~LeakyAlg
virtual ~LeakyAlg()
Destructor:
Definition
PerfMonTestLeakyAlg.cxx:24
PerfMonTest::LeakyAlg::m_leaks
std::list< Leak * > m_leaks
container to hold the leaked objects
Definition
PerfMonTestLeakyAlg.h:59
PerfMonTest::LeakyAlg::m_leakSize
Gaudi::Property< int > m_leakSize
Property to setup the size of the leak.
Definition
PerfMonTestLeakyAlg.h:49
PerfMonTest::LeakyAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
PerfMonTestLeakyAlg.cxx:48
PerfMonTest
PerfMonTestPolyVectorAlg.h Example for the memory optimization tutorial.
Definition
Control/PerformanceMonitoring/PerfMonTests/src/Hit.h:7
PerfMonTest::LeakyAlg::Leak
Definition
PerfMonTestLeakyAlg.h:51
PerfMonTest::LeakyAlg::Leak::m_data
std::vector< int > m_data
Definition
PerfMonTestLeakyAlg.h:52
Generated on
for ATLAS Offline Software by
1.17.0