summaryrefslogtreecommitdiffstats
path: root/libcxx/src/thread.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-12-17 14:46:43 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-12-17 14:46:43 +0000
commitc950e77d1d0431b9fa9144e9ea7eaa858d8e032e (patch)
tree31a672a40ebda8b5227d84a342b243b1099c6700 /libcxx/src/thread.cpp
parent166cfa3a428aaf9f0cf780461b4c21aea45eb905 (diff)
downloadbcm5719-llvm-c950e77d1d0431b9fa9144e9ea7eaa858d8e032e.tar.gz
bcm5719-llvm-c950e77d1d0431b9fa9144e9ea7eaa858d8e032e.zip
Effort to reduce the number of exported symbols
llvm-svn: 122057
Diffstat (limited to 'libcxx/src/thread.cpp')
-rw-r--r--libcxx/src/thread.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 15ab40e3e82..4ccff3277f5 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -92,10 +92,25 @@ __thread_local_data()
// __thread_struct_imp
-class __thread_struct_imp
+template <class T>
+class _LIBCPP_HIDDEN __hidden_allocator
{
- typedef vector<__assoc_sub_state*> _AsyncStates;
- typedef vector<pair<condition_variable*, mutex*> > _Notify;
+public:
+ typedef T value_type;
+
+ T* allocate(size_t __n)
+ {return static_cast<T*>(::operator new(__n * sizeof(T)));}
+ void deallocate(T* __p, size_t) {::operator delete((void*)__p);}
+
+ size_t max_size() const {return size_t(~0) / sizeof(T);}
+};
+
+class _LIBCPP_HIDDEN __thread_struct_imp
+{
+ typedef vector<__assoc_sub_state*,
+ __hidden_allocator<__assoc_sub_state*> > _AsyncStates;
+ typedef vector<pair<condition_variable*, mutex*>,
+ __hidden_allocator<pair<condition_variable*, mutex*> > > _Notify;
_AsyncStates async_states_;
_Notify notify_;
OpenPOWER on IntegriCloud