Chromium Code Reviews| Index: runtime/bin/main.cc |
| diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc |
| index a430f8d1f5185e299cf76eb85f6ab822e6397667..2533fa3a8ee361e854e0e705aed806162d2e579f 100644 |
| --- a/runtime/bin/main.cc |
| +++ b/runtime/bin/main.cc |
| @@ -1356,6 +1356,22 @@ static bool FileModifiedCallback(const char* url, int64_t since) { |
| return modified; |
| } |
| +static const Dart_EmbedderInformation* GetEmbedderInformationCallback() { |
| + static Dart_EmbedderInformation information = { |
|
zra
2017/08/10 22:19:50
The VM could pass in a pointer to a Dart_EmbedderI
cbernaschina
2017/08/10 22:40:28
That was the first idea, the main problem is relat
zra
2017/08/10 22:49:46
I'm not sure this simple call is the right API for
cbernaschina
2017/08/12 00:29:41
Done.
|
| + "Dart VM", // name |
| + 0, // current_rss |
| + 0 // max_rss |
| + }; |
| + |
| + int64_t max_rss = Process::MaxRSS(); |
| + int64_t current_rss = Process::CurrentRSS(); |
| + |
| + information.max_rss = max_rss >= 0 ? max_rss : 0; |
| + information.current_rss = current_rss >= 0 ? current_rss : 0; |
| + |
| + return &information; |
| +} |
| + |
| static void GenerateAppAOTSnapshot() { |
| if (use_blobs) { |
| Snapshot::GenerateAppAOTAsBlobs(snapshot_filename); |
| @@ -1864,6 +1880,7 @@ void main(int argc, char** argv) { |
| Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, |
| &ServiceStreamCancelCallback); |
| Dart_SetFileModifiedCallback(&FileModifiedCallback); |
| + Dart_SetGetEmbedderInformationCallback(&GetEmbedderInformationCallback); |
| // Run the main isolate until we aren't told to restart. |
| while (RunMainIsolate(script_name, &dart_options)) { |