blob: 75918d1c4a61b9222497bec548828a2f1ffcc8d1 [file] [log] [blame]
[email protected]237a14852012-04-28 02:56:381// 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
9namespace base {
10namespace allocator {
11
[email protected]237a14852012-04-28 02:56:3812void ReleaseFreeMemory() {
[email protected]094c8932012-09-17 11:44:1013 thunks::ReleaseFreeMemoryFunction release_free_memory_function =
[email protected]3b8759592012-12-07 12:19:5114 thunks::GetReleaseFreeMemoryFunction();
[email protected]094c8932012-09-17 11:44:1015 if (release_free_memory_function)
[email protected]237a14852012-04-28 02:56:3816 release_free_memory_function();
17}
18
[email protected]237a14852012-04-28 02:56:3819void SetReleaseFreeMemoryFunction(
[email protected]094c8932012-09-17 11:44:1020 thunks::ReleaseFreeMemoryFunction release_free_memory_function) {
[email protected]3b8759592012-12-07 12:19:5121 DCHECK_EQ(thunks::GetReleaseFreeMemoryFunction(),
[email protected]094c8932012-09-17 11:44:1022 reinterpret_cast<thunks::ReleaseFreeMemoryFunction>(NULL));
[email protected]3b8759592012-12-07 12:19:5123 thunks::SetReleaseFreeMemoryFunction(release_free_memory_function);
[email protected]237a14852012-04-28 02:56:3824}
25
ssid09434092015-10-26 23:05:0426void 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]237a14852012-04-28 02:56:3833} // namespace allocator
34} // namespace base