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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/allocator/allocator_extension_thunks.h"
6
7 #include <cstddef> // for NULL
8
9 namespace base {
10 namespace allocator {
11 namespace thunks {
12
13 // 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
14 // allocator_unittests works on windows. That target has to perform
15 // tcmalloc-specific initialization on windows, but it cannot depend on base
16 // otherwise. This target sits in the middle - both libbase and
17 // allocator_unittests can depend on it.
18 // This file can't depend on anything else in base, including logging.
19
20 static GetStatsFunction* g_get_stats_function = NULL;
21 static ReleaseFreeMemoryFunction* g_release_free_memory_function = NULL;
22
23 void SetGetStatsFunction(GetStatsFunction* get_stats_function) {
24 g_get_stats_function = get_stats_function;
25 }
26
27 GetStatsFunction* GetGetStatsFunction() {
28 return g_get_stats_function;
29 }
30
31 void SetReleaseFreeMemoryFunction(
32 ReleaseFreeMemoryFunction* release_free_memory_function) {
33 g_release_free_memory_function = release_free_memory_function;
34 }
35
36 ReleaseFreeMemoryFunction* GetReleaseFreeMemoryFunction() {
37 return g_release_free_memory_function;
38 }
39
40 } // namespace thunks
41 } // namespace allocator
42 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698