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

Unified Diff: base/allocator/allocator_extension.cc

Issue 1505743002: Remove allocator_extension_thunks since this layer is not required (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@allocator_clean_win
Patch Set: rebase Created 5 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 | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_extension.cc
diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc
index 75918d1c4a61b9222497bec548828a2f1ffcc8d1..4f0b3a90032b9b7c48f33b1f1b2336b836353deb 100644
--- a/base/allocator/allocator_extension.cc
+++ b/base/allocator/allocator_extension.cc
@@ -9,25 +9,31 @@
namespace base {
namespace allocator {
+namespace {
+ReleaseFreeMemoryFunction g_release_free_memory_function = nullptr;
+GetNumericPropertyFunction g_get_numeric_property_function = nullptr;
+}
+
void ReleaseFreeMemory() {
- thunks::ReleaseFreeMemoryFunction release_free_memory_function =
- thunks::GetReleaseFreeMemoryFunction();
- if (release_free_memory_function)
- release_free_memory_function();
+ if (g_release_free_memory_function)
+ g_release_free_memory_function();
+}
+
+bool GetNumericProperty(const char* name, size_t* value) {
+ return g_get_numeric_property_function &&
+ g_get_numeric_property_function(name, value);
}
void SetReleaseFreeMemoryFunction(
- thunks::ReleaseFreeMemoryFunction release_free_memory_function) {
- DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(),
- reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL));
- thunks::SetReleaseFreeMemoryFunction(release_free_memory_function);
+ ReleaseFreeMemoryFunction release_free_memory_function) {
+ DCHECK(!g_release_free_memory_function);
+ g_release_free_memory_function = release_free_memory_function;
}
void SetGetNumericPropertyFunction(
- thunks::GetNumericPropertyFunction get_numeric_property_function) {
- DCHECK_EQ(thunks::GetGetNumericPropertyFunction(),
- reinterpret_cast<thunks::GetNumericPropertyFunction>(NULL));
- thunks::SetGetNumericPropertyFunction(get_numeric_property_function);
+ GetNumericPropertyFunction get_numeric_property_function) {
+ DCHECK(!g_get_numeric_property_function);
+ g_get_numeric_property_function = get_numeric_property_function;
}
} // namespace allocator
« no previous file with comments | « base/allocator/allocator_extension.h ('k') | base/allocator/allocator_extension_thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698