ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
misc
memstat
test
leak_test.C
Go to the documentation of this file.
1
// @(#)root/memstat:$Name$:$Id$
2
// Author: M.Ivanov -- Anar Manafov (A.Manafov@gsi.de) 28/04/2008
3
4
/*************************************************************************
5
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include "
TH1.h
"
13
// MemStat
14
#include "
TMemStat.h
"
15
16
const
int
g_count
= 2;
17
18
void
test1
()
19
{
20
double
*
x
[
g_count
];
21
for
(
int
i = 0; i <
g_count
; ++i) {
22
x[i] =
new
double
[i+1];
23
}
24
for
(
int
i = 0; i <
g_count
; ++i) {
25
delete
x[i];
26
}
27
}
28
void
test2
()
29
{
30
TH1F
*
h
[100];
31
for
(
int
i = 0; i < 100; ++i) {
32
h[i] =
new
TH1F
(
Form
(
"h%d"
, i),
"test"
, 10 + i, 0, 10);
33
h[i]->
Sumw2
();
34
}
35
}
36
void
leak_test
()
37
{
38
TMemStat
m
(
"gnubuiltin"
);
39
test1
();
40
test2
();
41
}
TMemStat.h
h
TH1 * h
Definition:
legend2.C:5
leak_test
void leak_test()
Definition:
leak_test.C:36
TMemStat
Definition:
TMemStat.h:18
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition:
TH1.h:570
x
Double_t x[n]
Definition:
legend1.C:17
g_count
const int g_count
Definition:
leak_test.C:16
test2
void test2()
Definition:
leak_test.C:28
m
TMarker * m
Definition:
textangle.C:8
Form
char * Form(const char *fmt,...)
TH1::Sumw2
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition:
TH1.cxx:8350
TH1.h
test1
void test1()
Definition:
leak_test.C:18