OLD | NEW |
(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 #ifndef BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H |
| 6 #define BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H |
| 7 #pragma once |
| 8 |
| 9 #include "base/allocator/allocator_extension_thunks.h" |
| 10 #include "base/base_export.h" |
| 11 #include "build/build_config.h" |
| 12 |
| 13 namespace base { |
| 14 namespace allocator { |
| 15 |
| 16 // Request that the allocator print a human-readable description of the current |
| 17 // state of the allocator into a null-terminated string in the memory segment |
| 18 // buffer[0,buffer_length-1]. |
| 19 // |
| 20 // |buffer| must point to a valid piece of memory |
| 21 // |buffer_length| must be > 0. |
| 22 BASE_EXPORT void GetStats(char* buffer, int buffer_length); |
| 23 |
| 24 // Request that the allocator release any free memory it knows about to the |
| 25 // system. |
| 26 BASE_EXPORT void ReleaseFreeMemory(); |
| 27 |
| 28 |
| 29 // These settings allow specifying a callback used to implement the allocator |
| 30 // extension functions. These are optional, but if set they must only be set |
| 31 // once. These will typically called in an allocator-specific initialization |
| 32 // routine. |
| 33 // |
| 34 // No threading promises are made. The caller is responsible for making sure |
| 35 // these pointers are set before any other threads attempt to call the above |
| 36 // functions. |
| 37 BASE_EXPORT void SetGetStatsFunction( |
| 38 thunks::GetStatsFunction* get_stats_function); |
| 39 |
| 40 BASE_EXPORT void SetReleaseFreeMemoryFunction( |
| 41 thunks::ReleaseFreeMemoryFunction* release_free_memory_function); |
| 42 } // namespace allocator |
| 43 } // namespace base |
| 44 |
| 45 #endif |
OLD | NEW |