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

Unified Diff: include/iosfwd

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/deque ('k') | include/list » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/iosfwd
diff --git a/include/iosfwd b/include/iosfwd
index eccfd349a4a58a0484a1170d330e955be326d1e4..1e88a860f4a76407b5970349c3374498600d0de5 100644
--- a/include/iosfwd
+++ b/include/iosfwd
@@ -100,6 +100,35 @@ class _LIBCPP_TYPE_VIS ios_base;
template<class _CharT> struct _LIBCPP_TYPE_VIS_ONLY char_traits;
template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY allocator;
+// TODO: forward_list
+enum class allocation_group
+{
+ allocator,
+ deque,
+ list,
+ map,
+ multimap,
+ multiset,
+ set,
+ shared_ptr,
+ string,
+ unordered_map,
+ unordered_multimap,
+ unordered_multiset,
+ unordered_set,
+ vector,
+ vector_bool,
+
+ group_count,
+ invalid_group = group_count
+};
+constexpr size_t allocation_group_count = static_cast<size_t>(allocation_group::group_count);
+
+const char* get_allocation_group_name(allocation_group group);
+
+template <class T, allocation_group Group, class Payload = T>
+class _LIBCPP_TYPE_VIS_ONLY counting_allocator;
+
template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY basic_ios;
@@ -113,16 +142,16 @@ template <class _CharT, class _Traits = char_traits<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY basic_iostream;
template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
+ class _Allocator = counting_allocator<_CharT, allocation_group::string> >
class _LIBCPP_TYPE_VIS_ONLY basic_stringbuf;
template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
+ class _Allocator = counting_allocator<_CharT, allocation_group::string> >
class _LIBCPP_TYPE_VIS_ONLY basic_istringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
+ class _Allocator = counting_allocator<_CharT, allocation_group::string> >
class _LIBCPP_TYPE_VIS_ONLY basic_ostringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
+ class _Allocator = counting_allocator<_CharT, allocation_group::string> >
class _LIBCPP_TYPE_VIS_ONLY basic_stringstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
@@ -189,10 +218,10 @@ typedef long long streamoff; // for char_traits in <string>
template <class _CharT, // for <stdexcept>
class _Traits = char_traits<_CharT>,
- class _Allocator = allocator<_CharT> >
+ class _Allocator = counting_allocator<_CharT, allocation_group::string> >
class _LIBCPP_TYPE_VIS_ONLY basic_string;
-typedef basic_string<char, char_traits<char>, allocator<char> > string;
-typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
+typedef basic_string<char, char_traits<char>, counting_allocator<char, allocation_group::string> > string;
+typedef basic_string<wchar_t, char_traits<wchar_t>, counting_allocator<wchar_t, allocation_group::string> > wstring;
_LIBCPP_END_NAMESPACE_STD
« no previous file with comments | « include/deque ('k') | include/list » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698