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

Side by Side 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 unified diff | 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 »
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.h" 5 #include "base/allocator/allocator_extension.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace base { 9 namespace base {
10 namespace allocator { 10 namespace allocator {
11 11
12 namespace {
13 ReleaseFreeMemoryFunction g_release_free_memory_function = nullptr;
14 GetNumericPropertyFunction g_get_numeric_property_function = nullptr;
15 }
16
12 void ReleaseFreeMemory() { 17 void ReleaseFreeMemory() {
13 thunks::ReleaseFreeMemoryFunction release_free_memory_function = 18 if (g_release_free_memory_function)
14 thunks::GetReleaseFreeMemoryFunction(); 19 g_release_free_memory_function();
15 if (release_free_memory_function) 20 }
16 release_free_memory_function(); 21
22 bool GetNumericProperty(const char* name, size_t* value) {
23 return g_get_numeric_property_function &&
24 g_get_numeric_property_function(name, value);
17 } 25 }
18 26
19 void SetReleaseFreeMemoryFunction( 27 void SetReleaseFreeMemoryFunction(
20 thunks::ReleaseFreeMemoryFunction release_free_memory_function) { 28 ReleaseFreeMemoryFunction release_free_memory_function) {
21 DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(), 29 DCHECK(!g_release_free_memory_function);
22 reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL)); 30 g_release_free_memory_function = release_free_memory_function;
23 thunks::SetReleaseFreeMemoryFunction(release_free_memory_function);
24 } 31 }
25 32
26 void SetGetNumericPropertyFunction( 33 void SetGetNumericPropertyFunction(
27 thunks::GetNumericPropertyFunction get_numeric_property_function) { 34 GetNumericPropertyFunction get_numeric_property_function) {
28 DCHECK_EQ(thunks::GetGetNumericPropertyFunction(), 35 DCHECK(!g_get_numeric_property_function);
29 reinterpret_cast<thunks::GetNumericPropertyFunction>(NULL)); 36 g_get_numeric_property_function = get_numeric_property_function;
30 thunks::SetGetNumericPropertyFunction(get_numeric_property_function);
31 } 37 }
32 38
33 } // namespace allocator 39 } // namespace allocator
34 } // namespace base 40 } // namespace base
OLDNEW
« 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