Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooTrace.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooTrace.h,v 1.16 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_TRACE
17#define ROO_TRACE
18
19#include "RooLinkedList.h"
20#include <map>
21#include <string>
22
23#define TRACE_CREATE
24#define TRACE_DESTROY
25
26class R__DEPRECATED(6, 44, "RooTrace is unused and untested, and its hooks are compiled out by default. "
27 "For memory debugging, please use general-purpose tools like AddressSanitizer "
28 "or Valgrind instead.") RooTrace {
29public:
30 RooTrace() ;
31 virtual ~RooTrace() {} ;
32
33 static void create(const TObject* obj) ;
34 static void destroy(const TObject* obj) ;
35
36
37 static void createSpecial(const char* name, int size) ;
38 static void destroySpecial(const char* name) ;
39
40
41 static void active(bool flag) ;
42 static void verbose(bool flag) ;
43
44 static void dump() ;
45 static void dump(std::ostream& os, bool sinceMarked=false) ;
46 static void mark() ;
47
48 static void callgrind_zero() ;
49 static void callgrind_dump() ;
50
51
52 static RooTrace& instance() ;
53
54 static void printObjectCounts() ;
55
56
57protected:
58
59 static RooTrace* _instance ;
60
61 void dump3(std::ostream&, bool sinceMarked) ;
62
63 void mark3() ;
64 void printObjectCounts3() ;
65
66 void create2(const TObject* obj) ;
67 void destroy2(const TObject* obj) ;
68
69 void create3(const TObject* obj) ;
70 void destroy3(const TObject* obj) ;
71
72 void createSpecial3(const char* name, int size) ;
73 void destroySpecial3(const char* name) ;
74
75 void addPad(const TObject* ref, bool doPad) ;
76 bool removePad(const TObject* ref) ;
77
78 bool _active ;
79 bool _verbose ;
80 RooLinkedList _list ;
82 std::map<TClass*,int> _objectCount ;
83 std::map<std::string,int> _specialCount ;
84 std::map<std::string,int> _specialSize ;
85
86 ClassDef(RooTrace,0) // Memory tracer utility for RooFit objects
87};
88
89
90#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:510
static Roo_reg_AGKInteg1D instance
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define ClassDef(name, id)
Definition Rtypes.h:344
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
char name[80]
Definition TGX11.cxx:148
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
Mother of all ROOT objects.
Definition TObject.h:42