[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 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.h" | ||||
6 | |||||
7 | #include "base/logging.h" | ||||
8 | |||||
9 | namespace base { | ||||
10 | namespace allocator { | ||||
11 | |||||
[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 12 | void ReleaseFreeMemory() { |
[email protected] | 094c893 | 2012-09-17 11:44:10 | [diff] [blame] | 13 | thunks::ReleaseFreeMemoryFunction release_free_memory_function = |
[email protected] | 3b875959 | 2012-12-07 12:19:51 | [diff] [blame] | 14 | thunks::GetReleaseFreeMemoryFunction(); |
[email protected] | 094c893 | 2012-09-17 11:44:10 | [diff] [blame] | 15 | if (release_free_memory_function) |
[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 16 | release_free_memory_function(); |
17 | } | ||||
18 | |||||
[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 19 | void SetReleaseFreeMemoryFunction( |
[email protected] | 094c893 | 2012-09-17 11:44:10 | [diff] [blame] | 20 | thunks::ReleaseFreeMemoryFunction release_free_memory_function) { |
[email protected] | 3b875959 | 2012-12-07 12:19:51 | [diff] [blame] | 21 | DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(), |
[email protected] | 094c893 | 2012-09-17 11:44:10 | [diff] [blame] | 22 | reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL)); |
[email protected] | 3b875959 | 2012-12-07 12:19:51 | [diff] [blame] | 23 | thunks::SetReleaseFreeMemoryFunction(release_free_memory_function); |
[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 24 | } |
25 | |||||
ssid | 0943409 | 2015-10-26 23:05:04 | [diff] [blame] | 26 | void SetGetNumericPropertyFunction( |
27 | thunks::GetNumericPropertyFunction get_numeric_property_function) { | ||||
28 | DCHECK_EQ(thunks::GetGetNumericPropertyFunction(), | ||||
29 | reinterpret_cast<thunks::GetNumericPropertyFunction>(NULL)); | ||||
30 | thunks::SetGetNumericPropertyFunction(get_numeric_property_function); | ||||
31 | } | ||||
32 | |||||
[email protected] | 237a1485 | 2012-04-28 02:56:38 | [diff] [blame] | 33 | } // namespace allocator |
34 | } // namespace base |