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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/heap_profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 7453f24c8a29b39b5752ab0ed0ef182df305189d..9ab8c681dd54e94619c0ec0d3cbdfc077be6f72d 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -314,7 +314,7 @@ DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet(Dart_Handle* keys,
Dart_Handle* values,
intptr_t num_values);
-// --- Garbage Collection Callbacks --
+// --- Garbage Collection Callbacks ---
/**
* Callbacks signal the beginning and end of a garbage collection.
@@ -384,6 +384,29 @@ DART_EXPORT Dart_Handle Dart_AddGcEpilogueCallback(
DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback(
Dart_GcEpilogueCallback callback);
+// --- Heap Profiler ---
+
+/**
+ * A callback invoked by the heap profiler during profiling to write
+ * data.
+ */
+typedef void (*Dart_HeapProfileWriteCallback)(const void* data,
+ intptr_t length,
+ void* stream);
+
+/**
+ * Generates a heap profile.
+ *
+ * \param callback A function pointer that will be repeatedly invoked
+ * with heap profile data.
+ * \param stream A pointer that will be passed to the callback. This
+ * is a convenient way to provide an open stream to the callback.
+ *
+ * \return Success if the heap profile is successful.
+ */
+DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback,
+ void* stream);
+
// --- Initialization and Globals ---
/**
« 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