Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -18,17 +18,15 @@
|
||||
namespace tools {
|
||||
|
||||
class mem {
|
||||
public:
|
||||
protected:
|
||||
mem(){increment();}
|
||||
virtual ~mem(){decrement();}
|
||||
private:
|
||||
mem(const mem&){}
|
||||
mem& operator=(const mem&){return *this;}
|
||||
public:
|
||||
static void increment(){counter()++;}
|
||||
static void decrement(){counter()--;}
|
||||
|
||||
|
||||
static void increment(const char* a_class){
|
||||
counter()++;
|
||||
if(check_by_class()) {
|
||||
@@ -90,11 +88,13 @@ public:
|
||||
}
|
||||
list().clear();
|
||||
}
|
||||
private:
|
||||
|
||||
static int& counter() {
|
||||
static int s_count = 0;
|
||||
return s_count;
|
||||
}
|
||||
|
||||
protected:
|
||||
static bool& check_by_class() {
|
||||
static bool s_check_by_class = false;
|
||||
return s_check_by_class;
|
||||
@@ -108,6 +108,16 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
inline const std::string& s_new() {
|
||||
static const std::string s_v("new");
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& s_malloc() {
|
||||
static const std::string s_v("malloc");
|
||||
return s_v;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user