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/base_export.h" | |
10 #include "build/build_config.h" | |
11 | |
12 namespace base { | |
13 namespace allocator { | |
14 | |
15 // Request that the allocator print a human-readable description of the current | |
16 // state of the allocator into a null-terminated string in the memory segment | |
17 // buffer[0,buffer_length-1]. | |
18 // | |
19 // |buffer| must point to a valid piece of memory | |
20 // |buffer_length| must be > 0. | |
21 BASE_EXPORT void GetStats(char* buffer, int buffer_length); | |
22 | |
23 // Request that the allocator release any free memory it knows about to the | |
24 // system. | |
25 BASE_EXPORT void ReleaseFreeMemory(); | |
26 | |
27 | |
28 // These settings allow specifying a callback used to implement the allocator | |
29 // extension functions. These are optional, but if set they must only be set | |
30 // once. These will typically called in an allocator-specific initialization | |
31 // routine. | |
willchan no longer on Chromium
2012/04/26 22:08:48
You should note that they are not threadsafe.
| |
32 typedef void GetStatsFunction(char*, int); | |
33 BASE_EXPORT void SetGetStatsFunction(GetStatsFunction* get_stats_function); | |
34 | |
35 typedef void ReleaseFreeMemoryFunction(); | |
36 BASE_EXPORT void SetReleaseFreeMemoryFunction( | |
37 ReleaseFreeMemoryFunction* release_free_memory_function); | |
38 } // namespace allocator | |
39 } // namespace base | |
40 | |
41 #endif | |
OLD | NEW |