Index: base/allocator/allocator_extension_thunks.cc |
diff --git a/base/allocator/allocator_extension_thunks.cc b/base/allocator/allocator_extension_thunks.cc |
index 8d0358db4b7f352dd99e49c128beda3c2aa144d2..246eb29a6b844ea2ca4a406a919b9229e9dcf0f6 100644 |
--- a/base/allocator/allocator_extension_thunks.cc |
+++ b/base/allocator/allocator_extension_thunks.cc |
@@ -11,50 +11,19 @@ namespace allocator { |
namespace thunks { |
// This slightly odd translation unit exists because of the peculularity of how |
-// allocator_unittests work on windows. That target has to perform |
-// tcmalloc-specific initialization on windows, but it cannot depend on base |
-// otherwise. This target sits in the middle - base and allocator_unittests |
-// can depend on it. This file can't depend on anything else in base, including |
-// logging. |
- |
-static GetAllocatorWasteSizeFunction g_get_allocator_waste_size_function = NULL; |
-static GetStatsFunction g_get_stats_function = NULL; |
-static ReleaseFreeMemoryFunction g_release_free_memory_function = NULL; |
-static GetNumericPropertyFunction g_get_numeric_property_function = NULL; |
- |
-void SetGetAllocatorWasteSizeFunction( |
- GetAllocatorWasteSizeFunction get_allocator_waste_size_function) { |
- g_get_allocator_waste_size_function = get_allocator_waste_size_function; |
-} |
- |
-GetAllocatorWasteSizeFunction GetGetAllocatorWasteSizeFunction() { |
- return g_get_allocator_waste_size_function; |
-} |
- |
-void SetGetStatsFunction(GetStatsFunction get_stats_function) { |
- g_get_stats_function = get_stats_function; |
-} |
+// allocator_unittests work. That target has to perform tcmalloc-specific |
+// initialization, but it cannot depend on base otherwise. This target sits in |
+// the middle - base and allocator_unittests can depend on it. This file can't |
+// depend on anything else in base, including logging. |
-GetStatsFunction GetGetStatsFunction() { |
- return g_get_stats_function; |
-} |
- |
-void SetReleaseFreeMemoryFunction( |
- ReleaseFreeMemoryFunction release_free_memory_function) { |
- g_release_free_memory_function = release_free_memory_function; |
-} |
- |
-ReleaseFreeMemoryFunction GetReleaseFreeMemoryFunction() { |
- return g_release_free_memory_function; |
-} |
+static AllocatorExtensionFunctions g_allocator_extension_functions; |
-void SetGetNumericPropertyFunction( |
- GetNumericPropertyFunction get_numeric_property_function) { |
- g_get_numeric_property_function = get_numeric_property_function; |
+void SetAllocatorExtensionFunctions(AllocatorExtensionFunctions functions) { |
+ g_allocator_extension_functions = functions; |
} |
-GetNumericPropertyFunction GetGetNumericPropertyFunction() { |
- return g_get_numeric_property_function; |
+AllocatorExtensionFunctions GetAllocatorExtensionFunctions() { |
+ return g_allocator_extension_functions; |
} |
} // namespace thunks |