Logo ROOT   6.08/07
Reference Guide
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 }
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Definition: THist.hxx:302
TH1 * h
Definition: legend2.C:5
void leak_test()
Definition: leak_test.C:36
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
Double_t x[n]
Definition: legend1.C:17
const int g_count
Definition: leak_test.C:16
void test2()
Definition: leak_test.C:28
TMarker * m
Definition: textangle.C:8
char * Form(const char *fmt,...)
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition: TH1.cxx:8130
void test1()
Definition: leak_test.C:18