From f01674e99a467e9eb99323130a1e1add4c57eda2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 14 Aug 2009 21:22:03 +0000 Subject: Massive freaking changes!!! Bu:;SharedCore actually is in and works, it's well tested and there are no known memory leaks or violations as of now. It's been applied to Bu::List and Bu::FBasicString so far. This means that everything using Bu::List and Bu::FBasicString will be much, much faster and use considerably less memory. I still have plans to apply this to Hash and maybe a couple of other core classes. --- src/tests/sharedcore.cpp | 24 ++++++++++++------------ src/tests/speed.cpp | 5 ++++- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'src/tests') diff --git a/src/tests/sharedcore.cpp b/src/tests/sharedcore.cpp index bdfde4c..9f65ac5 100644 --- a/src/tests/sharedcore.cpp +++ b/src/tests/sharedcore.cpp @@ -12,42 +12,42 @@ class Shint : public Bu::SharedCore public: Shint() { - data->val = 0; + core->val = 0; } Shint( int val ) { - data->val = val; + core->val = val; } - int getVal() + int getVal() const { - return data->val; + return core->val; } void setValBad( int val ) { - data->val = val; + core->val = val; } void setVal( int val ) { _hardCopy(); - data->val = val; + core->val = val; } bool operator==( const Shint &rhs ) { - if( data == rhs.data ) + if( core == rhs.core ) { - sio << "Same pointer (" << Fmt::ptr() << data << ")" << sio.nl; + sio << "Same pointer (" << Fmt::ptr() << core << ")" << sio.nl; return true; } - if( data->val == rhs.data->val ) + if( core->val == rhs.core->val ) { - sio << "Same value " << data->val << " (" - << Fmt::ptr() << data << " vs " - << Fmt::ptr() << rhs.data << ")" + sio << "Same value " << core->val << " (" + << Fmt::ptr() << core << " vs " + << Fmt::ptr() << rhs.core << ")" << sio.nl; return true; } diff --git a/src/tests/speed.cpp b/src/tests/speed.cpp index b8924d7..5b26dd3 100644 --- a/src/tests/speed.cpp +++ b/src/tests/speed.cpp @@ -43,6 +43,9 @@ void fullTest( tst t ) int main() { - fullTest( tstCopy("This is a test string.") ); + Bu::FString str; + for( int j = 0; j < 500; j++ ) + str.append("Hey, this is a test string. It will be reapeated many, many times. How's that?"); + fullTest( tstCopy( str ) ); } -- cgit v1.2.3