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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h

Issue 1979843002: Remove C::swap(C*) where C = Hash{Map,Set}<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HeapTest compile fixes Created 4 years, 7 months 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 | « third_party/WebKit/Source/wtf/HashSet.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return malloc<void*, void>(bytes, WTF_HEAP_PROFILER_TYPE_NAME(T)); 120 return malloc<void*, void>(bytes, WTF_HEAP_PROFILER_TYPE_NAME(T));
121 } 121 }
122 static void 122 static void
123 deleteArray(void* ptr) 123 deleteArray(void* ptr)
124 { 124 {
125 free(ptr); // Not the system free, the one from this class. 125 free(ptr); // Not the system free, the one from this class.
126 } 126 }
127 127
128 static bool isAllocationAllowed() { return true; } 128 static bool isAllocationAllowed() { return true; }
129 129
130 template<typename T>
131 struct OtherType {
132 typedef T* Type;
133 };
134
135 template<typename T>
136 static T& getOther(T* other)
137 {
138 return *other;
139 }
140
141 static void enterGCForbiddenScope() { } 130 static void enterGCForbiddenScope() { }
142 static void leaveGCForbiddenScope() { } 131 static void leaveGCForbiddenScope() { }
143 132
144 private: 133 private:
145 static void* allocateBacking(size_t, const char* typeName); 134 static void* allocateBacking(size_t, const char* typeName);
146 }; 135 };
147 136
148 // Specializations for heap profiling, so type profiling of |char| is possible 137 // Specializations for heap profiling, so type profiling of |char| is possible
149 // even in official builds (because |char| makes up a large portion of the heap. ) 138 // even in official builds (because |char| makes up a large portion of the heap. )
150 template <> WTF_EXPORT char* PartitionAllocator::allocateVectorBacking<char>(siz e_t); 139 template <> WTF_EXPORT char* PartitionAllocator::allocateVectorBacking<char>(siz e_t);
(...skipping 14 matching lines...) Expand all
165 { \ 154 { \
166 ASSERT(location); \ 155 ASSERT(location); \
167 return location; \ 156 return location; \
168 } \ 157 } \
169 private: \ 158 private: \
170 typedef int __thisIsHereToForceASemicolonAfterThisMacro 159 typedef int __thisIsHereToForceASemicolonAfterThisMacro
171 160
172 using WTF::PartitionAllocator; 161 using WTF::PartitionAllocator;
173 162
174 #endif // WTF_PartitionAllocator_h 163 #endif // WTF_PartitionAllocator_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/HashSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698