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

Unified Diff: base/allocator/allocator_extension_thunks.cc

Issue 10239012: Route calls to tcmalloc MallocExtension through allocator agnostic interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix base_nacl_win64 Created 8 years, 8 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
Index: base/allocator/allocator_extension_thunks.cc
diff --git a/base/allocator/allocator_extension_thunks.cc b/base/allocator/allocator_extension_thunks.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f8985a26826993d98df4ec3a170fd8c65595df79
--- /dev/null
+++ b/base/allocator/allocator_extension_thunks.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/allocator/allocator_extension_thunks.h"
+
+#include <cstddef> // for NULL
+
+namespace base {
+namespace allocator {
+namespace thunks {
+
+// This slightly odd translation unit exists because of the peculularity of how
willchan no longer on Chromium 2012/04/27 19:51:51 peculiarity ah, this makes more sense. a descript
+// allocator_unittests works 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 - both libbase and
+// allocator_unittests can depend on it.
+// This file can't depend on anything else in base, including logging.
+
+static GetStatsFunction* g_get_stats_function = NULL;
+static ReleaseFreeMemoryFunction* g_release_free_memory_function = NULL;
+
+void SetGetStatsFunction(GetStatsFunction* get_stats_function) {
+ g_get_stats_function = get_stats_function;
+}
+
+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;
+}
+
+} // namespace thunks
+} // namespace allocator
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698