Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: runtime/include/dart_api.h

Issue 10452006: Implement a heap profiler for the Dart managed heap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added basic test code Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/heap_profiler.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 * \param num_values the size of the values set 307 * \param num_values the size of the values set
308 * 308 *
309 * \return Success if the weak reference set could be created. 309 * \return Success if the weak reference set could be created.
310 * Otherwise, returns an error handle. 310 * Otherwise, returns an error handle.
311 */ 311 */
312 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys, 312 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys,
313 intptr_t num_keys, 313 intptr_t num_keys,
314 Dart_Handle* values, 314 Dart_Handle* values,
315 intptr_t num_values); 315 intptr_t num_values);
316 316
317 // --- Garbage Collection Callbacks -- 317 // --- Garbage Collection Callbacks ---
318 318
319 /** 319 /**
320 * Callbacks signal the beginning and end of a garbage collection. 320 * Callbacks signal the beginning and end of a garbage collection.
321 * 321 *
322 * These signals are intended to be used by the embedder to manage the 322 * These signals are intended to be used by the embedder to manage the
323 * lifetime of native objects with a managed object peer. 323 * lifetime of native objects with a managed object peer.
324 */ 324 */
325 325
326 /** 326 /**
327 * A callback invoked at the beginning of a garbage collection. 327 * A callback invoked at the beginning of a garbage collection.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 * \param callback A function pointer to an epilogue callback 377 * \param callback A function pointer to an epilogue callback
378 * function. This function must have been added as an epilogue 378 * function. This function must have been added as an epilogue
379 * callback. 379 * callback.
380 * 380 *
381 * \return Success if the callback was removed. Otherwise, returns an 381 * \return Success if the callback was removed. Otherwise, returns an
382 * error handle. 382 * error handle.
383 */ 383 */
384 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback( 384 DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback(
385 Dart_GcEpilogueCallback callback); 385 Dart_GcEpilogueCallback callback);
386 386
387 // --- Heap Profiler ---
388
389 /**
390 * A callback invoked by the heap profiler during profiling to write
391 * data.
392 */
393 typedef void (*Dart_HeapProfileWriteCallback)(const void* data,
394 intptr_t length,
395 void* stream);
396
397 /**
398 * Generates a heap profile.
399 *
400 * \param callback A function pointer that will be repeatedly invoked
401 * with heap profile data.
402 * \param stream A pointer that will be passed to the callback. This
403 * is a convenient way to provide an open stream to the callback.
404 *
405 * \return Success if the heap profile is successful.
406 */
407 DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback,
408 void* stream);
409
387 // --- Initialization and Globals --- 410 // --- Initialization and Globals ---
388 411
389 /** 412 /**
390 * An isolate creation and initialization callback function. 413 * An isolate creation and initialization callback function.
391 * 414 *
392 * This callback, provided by the embedder, is called when the vm 415 * This callback, provided by the embedder, is called when the vm
393 * needs to create an isolate. The callback should create an isolate 416 * needs to create an isolate. The callback should create an isolate
394 * by calling Dart_CreateIsolate and load any scripts required for 417 * by calling Dart_CreateIsolate and load any scripts required for
395 * execution. 418 * execution.
396 * 419 *
(...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 2132
2110 // --- Profiling support ---- 2133 // --- Profiling support ----
2111 2134
2112 // External pprof support for gathering and dumping symbolic 2135 // External pprof support for gathering and dumping symbolic
2113 // information that can be used for better profile reports for 2136 // information that can be used for better profile reports for
2114 // dynamically generated code. 2137 // dynamically generated code.
2115 DART_EXPORT void Dart_InitPprofSupport(); 2138 DART_EXPORT void Dart_InitPprofSupport();
2116 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 2139 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
2117 2140
2118 #endif // INCLUDE_DART_API_H_ 2141 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/heap_profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698