aboutsummaryrefslogtreecommitdiff
path: root/src/tests/sharedcore.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-08-14 21:22:03 +0000
committerMike Buland <eichlan@xagasoft.com>2009-08-14 21:22:03 +0000
commitf01674e99a467e9eb99323130a1e1add4c57eda2 (patch)
tree50bfa258b1c5761b2fbbac86d945d981669f27d4 /src/tests/sharedcore.cpp
parent42f4f849c683bc30404727f4dccc9d3cfd030adf (diff)
downloadlibbu++-f01674e99a467e9eb99323130a1e1add4c57eda2.tar.gz
libbu++-f01674e99a467e9eb99323130a1e1add4c57eda2.tar.bz2
libbu++-f01674e99a467e9eb99323130a1e1add4c57eda2.tar.xz
libbu++-f01674e99a467e9eb99323130a1e1add4c57eda2.zip
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.
Diffstat (limited to 'src/tests/sharedcore.cpp')
-rw-r--r--src/tests/sharedcore.cpp24
1 files changed, 12 insertions, 12 deletions
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<struct ShintCore>
12public: 12public:
13 Shint() 13 Shint()
14 { 14 {
15 data->val = 0; 15 core->val = 0;
16 } 16 }
17 17
18 Shint( int val ) 18 Shint( int val )
19 { 19 {
20 data->val = val; 20 core->val = val;
21 } 21 }
22 22
23 int getVal() 23 int getVal() const
24 { 24 {
25 return data->val; 25 return core->val;
26 } 26 }
27 27
28 void setValBad( int val ) 28 void setValBad( int val )
29 { 29 {
30 data->val = val; 30 core->val = val;
31 } 31 }
32 32
33 void setVal( int val ) 33 void setVal( int val )
34 { 34 {
35 _hardCopy(); 35 _hardCopy();
36 data->val = val; 36 core->val = val;
37 } 37 }
38 38
39 bool operator==( const Shint &rhs ) 39 bool operator==( const Shint &rhs )
40 { 40 {
41 if( data == rhs.data ) 41 if( core == rhs.core )
42 { 42 {
43 sio << "Same pointer (" << Fmt::ptr() << data << ")" << sio.nl; 43 sio << "Same pointer (" << Fmt::ptr() << core << ")" << sio.nl;
44 return true; 44 return true;
45 } 45 }
46 if( data->val == rhs.data->val ) 46 if( core->val == rhs.core->val )
47 { 47 {
48 sio << "Same value " << data->val << " (" 48 sio << "Same value " << core->val << " ("
49 << Fmt::ptr() << data << " vs " 49 << Fmt::ptr() << core << " vs "
50 << Fmt::ptr() << rhs.data << ")" 50 << Fmt::ptr() << rhs.core << ")"
51 << sio.nl; 51 << sio.nl;
52 return true; 52 return true;
53 } 53 }