Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: include/vector

Issue 2574553002: [counting-allocator] macOS buildtools/third_party/libc++/trunk/ changes.
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/unordered_set ('k') | src/memory.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // -*- C++ -*- 1 // -*- C++ -*-
2 //===------------------------------ vector --------------------------------===// 2 //===------------------------------ vector --------------------------------===//
3 // 3 //
4 // The LLVM Compiler Infrastructure 4 // The LLVM Compiler Infrastructure
5 // 5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open 6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details. 7 // Source Licenses. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 10
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 template <class _Tp, class _Allocator> 446 template <class _Tp, class _Allocator>
447 __vector_base<_Tp, _Allocator>::~__vector_base() 447 __vector_base<_Tp, _Allocator>::~__vector_base()
448 { 448 {
449 if (__begin_ != nullptr) 449 if (__begin_ != nullptr)
450 { 450 {
451 clear(); 451 clear();
452 __alloc_traits::deallocate(__alloc(), __begin_, capacity()); 452 __alloc_traits::deallocate(__alloc(), __begin_, capacity());
453 } 453 }
454 } 454 }
455 455
456 template <class _Tp, class _Allocator = allocator<_Tp> > 456 template <class _Tp, class _Allocator = counting_allocator<_Tp, allocation_group ::vector> >
457 class _LIBCPP_TYPE_VIS_ONLY vector 457 class _LIBCPP_TYPE_VIS_ONLY vector
458 : private __vector_base<_Tp, _Allocator> 458 : private __vector_base<_Tp, _Allocator>
459 { 459 {
460 private: 460 private:
461 typedef __vector_base<_Tp, _Allocator> __base; 461 typedef __vector_base<_Tp, _Allocator> __base;
462 typedef allocator<_Tp> __default_allocator_type; 462 typedef allocator<_Tp> __default_allocator_type;
463 public: 463 public:
464 typedef vector __self; 464 typedef vector __self;
465 typedef _Tp value_type; 465 typedef _Tp value_type;
466 typedef _Allocator allocator_type; 466 typedef _Allocator allocator_type;
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 typedef typename __alloc_traits::difference_type difference_type; 2122 typedef typename __alloc_traits::difference_type difference_type;
2123 typedef size_type __storage_type; 2123 typedef size_type __storage_type;
2124 typedef __bit_iterator<vector, false> pointer; 2124 typedef __bit_iterator<vector, false> pointer;
2125 typedef __bit_iterator<vector, true> const_pointer; 2125 typedef __bit_iterator<vector, true> const_pointer;
2126 typedef pointer iterator; 2126 typedef pointer iterator;
2127 typedef const_pointer const_iterator; 2127 typedef const_pointer const_iterator;
2128 typedef _VSTD::reverse_iterator<iterator> reverse_iterator; 2128 typedef _VSTD::reverse_iterator<iterator> reverse_iterator;
2129 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; 2129 typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
2130 2130
2131 private: 2131 private:
2132 typedef typename __rebind_alloc_helper<__alloc_traits, __storage_type>::type __storage_allocator; 2132 typedef typename __rebind_counting_alloc_helper<__alloc_traits, __storage_ty pe, false, allocation_group::vector_bool>::type __storage_allocator;
2133 typedef allocator_traits<__storage_allocator> __storage_traits; 2133 typedef allocator_traits<__storage_allocator> __storage_traits;
2134 typedef typename __storage_traits::pointer __storage_pointer; 2134 typedef typename __storage_traits::pointer __storage_pointer;
2135 typedef typename __storage_traits::const_pointer __const_storage_pointer; 2135 typedef typename __storage_traits::const_pointer __const_storage_pointer;
2136 2136
2137 __storage_pointer __begin_; 2137 __storage_pointer __begin_;
2138 size_type __size_; 2138 size_type __size_;
2139 __compressed_pair<size_type, __storage_allocator> __cap_alloc_; 2139 __compressed_pair<size_type, __storage_allocator> __cap_alloc_;
2140 public: 2140 public:
2141 typedef __bit_reference<vector> reference; 2141 typedef __bit_reference<vector> reference;
2142 typedef __bit_const_reference<vector> const_reference; 2142 typedef __bit_const_reference<vector> const_reference;
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 void 3306 void
3307 swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y) 3307 swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y)
3308 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 3308 _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
3309 { 3309 {
3310 __x.swap(__y); 3310 __x.swap(__y);
3311 } 3311 }
3312 3312
3313 _LIBCPP_END_NAMESPACE_STD 3313 _LIBCPP_END_NAMESPACE_STD
3314 3314
3315 #endif // _LIBCPP_VECTOR 3315 #endif // _LIBCPP_VECTOR
OLDNEW
« no previous file with comments | « include/unordered_set ('k') | src/memory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698