diff options
Diffstat (limited to 'libstdc++-v3/include/ext/pool_allocator.h')
-rw-r--r-- | libstdc++-v3/include/ext/pool_allocator.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h index cec7920..15e1eb4 100644 --- a/libstdc++-v3/include/ext/pool_allocator.h +++ b/libstdc++-v3/include/ext/pool_allocator.h @@ -41,14 +41,14 @@ */ /** @file ext/debug_allocator.h - * This file is a GNU extension to the Standard C++ Library. + * This file is a GNU extension to the Standard C++ Library. * You should only include this header if you are using GCC 3 or later. */ #ifndef _POOL_ALLOCATOR_H #define _POOL_ALLOCATOR_H 1 -#include <bits/functexcept.h> +#include <bits/functexcept.h> #include <bits/stl_threads.h> #include <bits/atomicity.h> #include <bits/allocator_traits.h> @@ -111,7 +111,7 @@ namespace __gnu_cxx static size_t _S_heap_size; static _STL_mutex_lock _S_lock; - static _Atomic_word _S_force_new; + static _Atomic_word _S_force_new; static size_t _S_round_up(size_t __bytes) @@ -152,7 +152,7 @@ namespace __gnu_cxx template<bool __threads, int __inst> inline bool - operator==(const __pool_alloc<__threads,__inst>&, + operator==(const __pool_alloc<__threads,__inst>&, const __pool_alloc<__threads,__inst>&) { return true; } @@ -289,7 +289,7 @@ namespace __gnu_cxx else __atomic_add(&_S_force_new, -1); } - + if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0)) __ret = __new_alloc::allocate(__n); else @@ -306,13 +306,13 @@ namespace __gnu_cxx { *__free_list = __result -> _M_free_list_link; __ret = __result; - } + } if (__builtin_expect(__ret == 0, 0)) __throw_bad_alloc(); } return __ret; } - + template<bool __threads, int __inst> void __pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n) @@ -323,7 +323,7 @@ namespace __gnu_cxx { _Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n); _Obj* __q = (_Obj*)__p; - + // Acquire the lock here with a constructor call. This // ensures that it is released in exit or during stack // unwinding. @@ -368,9 +368,9 @@ namespace std template<typename _Tp, bool __thr, int __inst> struct _Alloc_traits<_Tp, __gnu_cxx::__pool_alloc<__thr, __inst> > { - static const bool _S_instanceless = true; - typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type; - typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type; + static const bool _S_instanceless = true; + typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type; + typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type; typedef __allocator<_Tp, base_alloc_type> allocator_type; }; //@} @@ -379,11 +379,11 @@ namespace std /// Versions for the __allocator adaptor used with the predefined /// "SGI" style allocators. template<typename _Tp, typename _Tp1, bool __thr, int __inst> - struct _Alloc_traits<_Tp, __allocator<_Tp1, + struct _Alloc_traits<_Tp, __allocator<_Tp1, __gnu_cxx::__pool_alloc<__thr, __inst> > > { static const bool _S_instanceless = true; - typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type; + typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type; typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type; typedef __allocator<_Tp, base_alloc_type> allocator_type; }; |