Chromium Code Reviews| 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 --- |