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

Side by Side Diff: base/allocator/allocator_extension_thunks.cc

Issue 10825250: Expose memory allocator internal stats and properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add jemalloc.h include Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/allocator/allocator_extension_thunks.h ('k') | base/allocator/allocator_shim.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/allocator/allocator_extension_thunks.h" 5 #include "base/allocator/allocator_extension_thunks.h"
6 6
7 #include <cstddef> // for NULL 7 #include <cstddef> // for NULL
8 8
9 namespace base { 9 namespace base {
10 namespace allocator { 10 namespace allocator {
11 namespace thunks { 11 namespace thunks {
12 12
13 // This slightly odd translation unit exists because of the peculularity of how 13 // This slightly odd translation unit exists because of the peculularity of how
14 // allocator_unittests work on windows. That target has to perform 14 // allocator_unittests work on windows. That target has to perform
15 // tcmalloc-specific initialization on windows, but it cannot depend on base 15 // tcmalloc-specific initialization on windows, but it cannot depend on base
16 // otherwise. This target sits in the middle - base and allocator_unittests 16 // otherwise. This target sits in the middle - base and allocator_unittests
17 // can depend on it. This file can't depend on anything else in base, including 17 // can depend on it. This file can't depend on anything else in base, including
18 // logging. 18 // logging.
19 19
20 static GetStatsFunction* g_get_stats_function = NULL; 20 static GetPropertyFunction g_get_property_function = NULL;
21 static ReleaseFreeMemoryFunction* g_release_free_memory_function = NULL; 21 static GetStatsFunction g_get_stats_function = NULL;
22 static ReleaseFreeMemoryFunction g_release_free_memory_function = NULL;
22 23
23 void SetGetStatsFunction(GetStatsFunction* get_stats_function) { 24 void SetGetPropertyFunction(GetPropertyFunction get_property_function) {
25 g_get_property_function = get_property_function;
26 }
27
28 GetPropertyFunction GetGetPropertyFunction() {
29 return g_get_property_function;
30 }
31
32 void SetGetStatsFunction(GetStatsFunction get_stats_function) {
24 g_get_stats_function = get_stats_function; 33 g_get_stats_function = get_stats_function;
25 } 34 }
26 35
27 GetStatsFunction* GetGetStatsFunction() { 36 GetStatsFunction GetGetStatsFunction() {
28 return g_get_stats_function; 37 return g_get_stats_function;
29 } 38 }
30 39
31 void SetReleaseFreeMemoryFunction( 40 void SetReleaseFreeMemoryFunction(
32 ReleaseFreeMemoryFunction* release_free_memory_function) { 41 ReleaseFreeMemoryFunction release_free_memory_function) {
33 g_release_free_memory_function = release_free_memory_function; 42 g_release_free_memory_function = release_free_memory_function;
34 } 43 }
35 44
36 ReleaseFreeMemoryFunction* GetReleaseFreeMemoryFunction() { 45 ReleaseFreeMemoryFunction GetReleaseFreeMemoryFunction() {
37 return g_release_free_memory_function; 46 return g_release_free_memory_function;
38 } 47 }
39 48
40 } // namespace thunks 49 } // namespace thunks
41 } // namespace allocator 50 } // namespace allocator
42 } // namespace base 51 } // namespace base
OLDNEW
« no previous file with comments | « base/allocator/allocator_extension_thunks.h ('k') | base/allocator/allocator_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698