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

Unified Diff: runtime/vm/dart_api_impl.cc

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: 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
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4b4a445b49d3653f28bc7cd5e7acaf6438cb03c9..61a3138ec5455aa10473b9727f8ad419f58a7839 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -608,6 +608,18 @@ DART_EXPORT Dart_Handle Dart_RemoveGcEpilogueCallback(
}
+DART_EXPORT Dart_Handle Dart_HeapProfile(Dart_HeapProfileWriteCallback callback,
+ void* stream) {
+ if (callback == NULL) {
+ return Api::NewError("%s expects argument 'callback' to be non-null.",
+ CURRENT_FUNC);
+ }
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
turnidge 2012/05/29 17:50:01 I would move the CHECK_ISOLATE above your callback
cshapiro 2012/06/01 04:27:02 I should have noticed that. Done.
+ isolate->heap()->Profile(callback, stream);
+ return Api::Success(isolate);
+}
+
// --- Initialization and Globals ---

Powered by Google App Engine
This is Rietveld 408576698