From 574ccee478b9da9457cdf0e476b8df6eb584b580 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 16 Jul 2012 06:48:11 +0000 Subject: Minor memory management, performance, and tracing improvements. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1361917 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/kernel/fstream.hpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'sca-cpp/trunk/kernel/fstream.hpp') diff --git a/sca-cpp/trunk/kernel/fstream.hpp b/sca-cpp/trunk/kernel/fstream.hpp index 5ea9df2d62..4f7f5152aa 100644 --- a/sca-cpp/trunk/kernel/fstream.hpp +++ b/sca-cpp/trunk/kernel/fstream.hpp @@ -78,6 +78,14 @@ public: ofstream(const ofstream& os) : file(os.file), owner(false) { } + const ofstream& operator=(const ofstream& os) { + if(this == &os) + return *this; + file = os.file; + owner = false; + return *this; + } + ~ofstream() { if (!owner) return; @@ -127,6 +135,14 @@ public: ifstream(const ifstream& is) : file(is.file), owner(false) { } + const ifstream& operator=(const ifstream& is) { + if(this == &is) + return *this; + file = is.file; + owner = false; + return *this; + } + ~ifstream() { if (!owner) return; @@ -351,7 +367,7 @@ const bool debug_isLogging() { * Log a debug message. */ const bool debugLog(const string& msg) { - gc_scoped_pool(); + gc_scoped_pool p; cdebug << msg << endl; return true; } @@ -360,7 +376,7 @@ const bool debugLog(const string& msg) { * Log a debug message and a value. */ template const bool debugLog(const V& v, const string& msg) { - gc_scoped_pool(); + gc_scoped_pool p; cdebug << msg << ": " << v << endl; return true; } @@ -369,7 +385,7 @@ template const bool debugLog(const V& v, const string& msg) { * Log a debug message and two values. */ template const bool debugLog(const V& v, const W& w, const string& msg) { - gc_scoped_pool(); + gc_scoped_pool p; cdebug << msg << ": " << v << " : " << w << endl; return true; } -- cgit v1.2.3