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

Unified Diff: base/allocator/allocator_shim.cc

Issue 2572593002: [counting_allocator] Chrome changes.
Patch Set: Surface max_size; instrument flat_set. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/allocator/allocator_shim.h ('k') | base/allocator/allocator_shim_override_cpp_symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_shim.cc
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index 7a5cfd6c6eeb1983553e9757a284b5ef96d52765..3abe2ac764d20abf823cf576b53f903949c017f6 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -173,6 +173,23 @@ ALWAYS_INLINE void* ShimCppNew(size_t size) {
return ptr;
}
+#if defined(_LIBCPP_COUNTING_ALLOCATOR)
+
+void* ShimTaggedCppNew(size_t size, std::new_tag tag) {
+ const allocator::AllocatorDispatch* const chain_head = GetChainHead();
+ void* ptr;
+ do {
+ if (chain_head->tagged_alloc_function) {
+ ptr = chain_head->tagged_alloc_function(chain_head, size, tag.value);
+ } else {
+ ptr = chain_head->alloc_function(chain_head, size, nullptr);
+ }
+ } while (!ptr && CallNewHandler(size));
+ return ptr;
+}
+
+#endif // _LIBCPP_COUNTING_ALLOCATOR
+
ALWAYS_INLINE void ShimCppDelete(void* address) {
void* context = nullptr;
#if defined(OS_MACOSX)
« no previous file with comments | « base/allocator/allocator_shim.h ('k') | base/allocator/allocator_shim_override_cpp_symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698