diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:33:19 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-24 20:35:17 (GMT) |
commit | 332d60c56dfaa11fdd135088279d15cd5983b3d4 (patch) | |
tree | dd77717a4e1732da929d5ff8a0471fa3f005e201 /3rdParty/Boost/src/boost/regex/pending | |
parent | 90c44a10fec26d2a0935b2d62e82b6a5be028373 (diff) | |
download | swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.zip swift-332d60c56dfaa11fdd135088279d15cd5983b3d4.tar.bz2 |
Upgraded Boost to 1.45.0.
Diffstat (limited to '3rdParty/Boost/src/boost/regex/pending')
-rw-r--r-- | 3rdParty/Boost/src/boost/regex/pending/object_cache.hpp | 16 | ||||
-rw-r--r-- | 3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp | 20 |
2 files changed, 16 insertions, 20 deletions
diff --git a/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp b/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp index e1aa191..db60e28 100644 --- a/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp +++ b/3rdParty/Boost/src/boost/regex/pending/object_cache.hpp @@ -41,10 +41,10 @@ public: typedef std::map<Key, list_iterator> map_type; typedef typename map_type::iterator map_iterator; typedef typename list_type::size_type size_type; - static boost::shared_ptr<Object const> get(const Key& k, size_type max_cache_size); + static boost::shared_ptr<Object const> get(const Key& k, size_type l_max_cache_size); private: - static boost::shared_ptr<Object const> do_get(const Key& k, size_type max_cache_size); + static boost::shared_ptr<Object const> do_get(const Key& k, size_type l_max_cache_size); struct data { @@ -58,7 +58,7 @@ private: }; template <class Key, class Object> -boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type max_cache_size) +boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type l_max_cache_size) { #ifdef BOOST_HAS_THREADS static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT; @@ -66,7 +66,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz boost::static_mutex::scoped_lock l(mut); if(l) { - return do_get(k, max_cache_size); + return do_get(k, l_max_cache_size); } // // what do we do if the lock fails? @@ -77,12 +77,12 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz return boost::shared_ptr<Object>(); #endif #else - return do_get(k, max_cache_size); + return do_get(k, l_max_cache_size); #endif } template <class Key, class Object> -boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type max_cache_size) +boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type l_max_cache_size) { typedef typename object_cache<Key, Object>::data object_data; typedef typename map_type::size_type map_size_type; @@ -128,7 +128,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, BOOST_ASSERT(s_data.index[k]->first.get() == result.get()); BOOST_ASSERT(&(s_data.index.find(k)->first) == s_data.cont.back().second); BOOST_ASSERT(s_data.index.find(k)->first == k); - if(s > max_cache_size) + if(s > l_max_cache_size) { // // We have too many items in the list, so we need to start @@ -137,7 +137,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, // list_iterator pos = s_data.cont.begin(); list_iterator last = s_data.cont.end(); - while((pos != last) && (s > max_cache_size)) + while((pos != last) && (s > l_max_cache_size)) { if(pos->first.unique()) { diff --git a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp index 334ef27..9c10050 100644 --- a/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp +++ b/3rdParty/Boost/src/boost/regex/pending/static_mutex.hpp @@ -96,8 +96,14 @@ class BOOST_REGEX_DECL scoped_static_mutex_lock public: scoped_static_mutex_lock(static_mutex& mut, bool lk = true); ~scoped_static_mutex_lock(); - operator void const*()const; - bool locked()const; + operator void const*()const + { + return locked() ? this : 0; + } + bool locked()const + { + return m_have_lock; + } void lock(); void unlock(); private: @@ -107,16 +113,6 @@ private: scoped_static_mutex_lock& operator=(const scoped_static_mutex_lock&); }; -inline scoped_static_mutex_lock::operator void const*()const -{ - return locked() ? this : 0; -} - -inline bool scoped_static_mutex_lock::locked()const -{ - return m_have_lock; -} - } // namespace #else |