Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2005, Google Inc. | 1 /* Copyright (c) 2005, Google Inc. |
| 2 * All rights reserved. | 2 * All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 * but the currently accumulated profiling information will be cleared. | 83 * but the currently accumulated profiling information will be cleared. |
| 84 */ | 84 */ |
| 85 PERFTOOLS_DLL_DECL void HeapProfilerStop(); | 85 PERFTOOLS_DLL_DECL void HeapProfilerStop(); |
| 86 | 86 |
| 87 /* Dump a profile now - can be used for dumping at a hopefully | 87 /* Dump a profile now - can be used for dumping at a hopefully |
| 88 * quiescent state in your program, in order to more easily track down | 88 * quiescent state in your program, in order to more easily track down |
| 89 * memory leaks. Will include the reason in the logged message | 89 * memory leaks. Will include the reason in the logged message |
| 90 */ | 90 */ |
| 91 PERFTOOLS_DLL_DECL void HeapProfilerDump(const char *reason); | 91 PERFTOOLS_DLL_DECL void HeapProfilerDump(const char *reason); |
| 92 | 92 |
| 93 /* Dump a profile now and store the filename where the profile is dumped to | |
| 94 * in addition to HeapProfilerDump(). | |
| 95 */ | |
| 96 PERFTOOLS_DLL_DECL void HeapProfilerDumpWithFileName( | |
| 97 const char *reason, | |
| 98 char* dumped_filename_buffer, | |
| 99 int filename_buffer_length); | |
|
Dai Mikurube (NOT FULLTIME)
2013/02/13 16:04:46
FYI, |dumped_filename_buffer| is output of this fu
| |
| 100 | |
| 93 /* Generate current heap profiling information. | 101 /* Generate current heap profiling information. |
| 94 * Returns an empty string when heap profiling is not active. | 102 * Returns an empty string when heap profiling is not active. |
| 95 * The returned pointer is a '\0'-terminated string allocated using malloc() | 103 * The returned pointer is a '\0'-terminated string allocated using malloc() |
| 96 * and should be free()-ed as soon as the caller does not need it anymore. | 104 * and should be free()-ed as soon as the caller does not need it anymore. |
| 97 */ | 105 */ |
| 98 PERFTOOLS_DLL_DECL char* GetHeapProfile(); | 106 PERFTOOLS_DLL_DECL char* GetHeapProfile(); |
| 99 | 107 |
| 100 /* Callback function for iterating through all allocated objects. Accepts | 108 /* Callback function for iterating through all allocated objects. Accepts |
| 101 * pointer to user data passed into IterateAllocatedObjects and pointer | 109 * pointer to user data passed into IterateAllocatedObjects and pointer |
| 102 * to the object being visited. | 110 * to the object being visited. |
| 103 */ | 111 */ |
| 104 typedef void (*AddressVisitor)(void* data, const void* ptr); | 112 typedef void (*AddressVisitor)(void* data, const void* ptr); |
| 105 | 113 |
| 106 /* Iterate over all live allocated objects. For each allocation the | 114 /* Iterate over all live allocated objects. For each allocation the |
| 107 * callback will be invoked with the data argument and allocation pointer. | 115 * callback will be invoked with the data argument and allocation pointer. |
| 108 */ | 116 */ |
| 109 PERFTOOLS_DLL_DECL void IterateAllocatedObjects(AddressVisitor callback, | 117 PERFTOOLS_DLL_DECL void IterateAllocatedObjects(AddressVisitor callback, |
| 110 void* data); | 118 void* data); |
| 111 | 119 |
| 112 #ifdef __cplusplus | 120 #ifdef __cplusplus |
| 113 } // extern "C" | 121 } // extern "C" |
| 114 #endif | 122 #endif |
| 115 | 123 |
| 116 #endif /* BASE_HEAP_PROFILER_H_ */ | 124 #endif /* BASE_HEAP_PROFILER_H_ */ |
| OLD | NEW |