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

Unified Diff: base/allocator/allocator_shim.cc

Issue 2499373003: [NOT FOR REVIEW] Basic allocator shim for macOS. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 95480ea4b6b510f52a244d529da7a16385c9d035..830348b6eaa5707136c2ef9c35456fd8ef025020 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -243,6 +243,13 @@ void ShimFree(void* address) {
return chain_head->free_function(chain_head, address);
}
+size_t ShimGetSizeEstimate(const void* address) {
+ const allocator::AllocatorDispatch* const chain_head = GetChainHead();
+ // TODO: Fix get_size_estimate() to take 'const void*'.
+ return chain_head->get_size_estimate_function(
+ chain_head, const_cast<void*>(address));
+}
+
} // extern "C"
#if !defined(OS_WIN)
@@ -259,6 +266,8 @@ void ShimFree(void* address) {
#elif defined(OS_WIN)
// On Windows we use plain link-time overriding of the CRT symbols.
#include "base/allocator/allocator_shim_override_ucrt_symbols_win.h"
+#elif defined(OS_MACOSX)
+#include "base/allocator/allocator_shim_override_mac_symbols.h"
#else
#include "base/allocator/allocator_shim_override_libc_symbols.h"
#endif
« no previous file with comments | « no previous file | base/allocator/allocator_shim_override_cpp_symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698