Chromium Code Reviews| Index: base/allocator/allocator_extension.cc |
| diff --git a/base/allocator/allocator_extension.cc b/base/allocator/allocator_extension.cc |
| index 75918d1c4a61b9222497bec548828a2f1ffcc8d1..a2b7088f7c8564bd4c3ff6325867e5960a1ec20a 100644 |
| --- a/base/allocator/allocator_extension.cc |
| +++ b/base/allocator/allocator_extension.cc |
| @@ -9,25 +9,33 @@ |
| namespace base { |
| namespace allocator { |
| +namespace { |
| +ReleaseFreeMemoryFunction g_release_free_memory_function = NULL; |
|
Primiano Tucci (use gerrit)
2015/12/02 13:50:42
s/NULL/nullptr/ since you are touching this file y
ssid
2015/12/02 14:03:34
Done.
|
| +GetNumericPropertyFunction g_get_numeric_property_function = NULL; |
| +} |
| + |
| void ReleaseFreeMemory() { |
| - thunks::ReleaseFreeMemoryFunction release_free_memory_function = |
| - thunks::GetReleaseFreeMemoryFunction(); |
| - if (release_free_memory_function) |
| - release_free_memory_function(); |
| + if (g_release_free_memory_function) |
| + g_release_free_memory_function(); |
| +} |
| + |
| +bool GetNumericProperty(const char* name, size_t* value) { |
| + return g_get_numeric_property_function != NULL && |
|
Primiano Tucci (use gerrit)
2015/12/02 13:50:42
s/!= NULL//
ssid
2015/12/02 14:03:34
Done.
|
| + g_get_numeric_property_function(name, value); |
| } |
| void SetReleaseFreeMemoryFunction( |
| - thunks::ReleaseFreeMemoryFunction release_free_memory_function) { |
| - DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(), |
| - reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL)); |
| - thunks::SetReleaseFreeMemoryFunction(release_free_memory_function); |
| + ReleaseFreeMemoryFunction release_free_memory_function) { |
| + DCHECK_EQ(g_release_free_memory_function, |
| + reinterpret_cast<ReleaseFreeMemoryFunction>(NULL)); |
| + g_release_free_memory_function = release_free_memory_function; |
| } |
| void SetGetNumericPropertyFunction( |
| - thunks::GetNumericPropertyFunction get_numeric_property_function) { |
| - DCHECK_EQ(thunks::GetGetNumericPropertyFunction(), |
| - reinterpret_cast<thunks::GetNumericPropertyFunction>(NULL)); |
| - thunks::SetGetNumericPropertyFunction(get_numeric_property_function); |
| + GetNumericPropertyFunction get_numeric_property_function) { |
| + DCHECK_EQ(g_get_numeric_property_function, |
| + reinterpret_cast<GetNumericPropertyFunction>(NULL)); |
| + g_get_numeric_property_function = get_numeric_property_function; |
| } |
| } // namespace allocator |