Commit f291fb72 authored by unknown's avatar unknown

Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/svoj/devel/mysql/test1-mysql-5.0

parents a1494918 12380536
...@@ -122,6 +122,7 @@ public: ...@@ -122,6 +122,7 @@ public:
friend sslFactory& GetSSL_Factory(); // singleton creator friend sslFactory& GetSSL_Factory(); // singleton creator
private: private:
static sslFactory instance;
sslFactory(const sslFactory&); // hide copy sslFactory(const sslFactory&); // hide copy
sslFactory& operator=(const sslFactory&); // and assign sslFactory& operator=(const sslFactory&); // and assign
}; };
...@@ -208,6 +209,7 @@ public: ...@@ -208,6 +209,7 @@ public:
private: private:
Sessions(const Sessions&); // hide copy Sessions(const Sessions&); // hide copy
Sessions& operator=(const Sessions&); // and assign Sessions& operator=(const Sessions&); // and assign
static Sessions instance;
}; };
......
...@@ -1346,17 +1346,18 @@ SSL_SESSION::~SSL_SESSION() ...@@ -1346,17 +1346,18 @@ SSL_SESSION::~SSL_SESSION()
} }
Sessions Sessions::instance; // simple singleton
Sessions& GetSessions() Sessions& GetSessions()
{ {
static Sessions instance; // simple singleton return Sessions::instance;
return instance;
} }
sslFactory sslFactory::instance;
sslFactory& GetSSL_Factory() sslFactory& GetSSL_Factory()
{ {
static sslFactory instance; // simple singleton return sslFactory::instance;
return instance;
} }
......
...@@ -258,6 +258,10 @@ private: ...@@ -258,6 +258,10 @@ private:
Integer(word value, unsigned int length); Integer(word value, unsigned int length);
static const Integer zero;
static const Integer one;
static const Integer two;
int PositiveCompare(const Integer& t) const; int PositiveCompare(const Integer& t) const;
friend void PositiveAdd(Integer& sum, const Integer& a, const Integer& b); friend void PositiveAdd(Integer& sum, const Integer& a, const Integer& b);
friend void PositiveSubtract(Integer& diff, const Integer& a, friend void PositiveSubtract(Integer& diff, const Integer& a,
......
...@@ -2844,23 +2844,24 @@ unsigned int Integer::Encode(byte* output, unsigned int outputLen, ...@@ -2844,23 +2844,24 @@ unsigned int Integer::Encode(byte* output, unsigned int outputLen,
} }
const Integer Integer::zero(1,2);
const Integer &Integer::Zero() const Integer &Integer::Zero()
{ {
static const Integer zero;
return zero; return zero;
} }
const Integer Integer::one(1,2);
const Integer &Integer::One() const Integer &Integer::One()
{ {
static const Integer one(1,2);
return one; return one;
} }
const Integer Integer::two(1,2);
const Integer &Integer::Two() const Integer &Integer::Two()
{ {
static const Integer two(2,2);
return two; return two;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment