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

Unified Diff: runtime/bin/process.cc

Issue 2822943002: [dart:io] Adds ProcessInfo.{max,current}Rss. Adds OS::MaxRSS on Fuchsia. (Closed)
Patch Set: Fix Fuchsia build Created 3 years, 8 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/bin/process.cc
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 80133289d3141ced18f0c5a6b77d6c58a02d28d7..ab2b9ace9d46b0dda925f0aa0d5531b430b64120 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -366,6 +366,26 @@ void FUNCTION_NAME(StringToSystemEncoding)(Dart_NativeArguments args) {
Dart_SetReturnValue(args, external_array);
}
+
+void FUNCTION_NAME(ProcessInfo_CurrentRSS)(Dart_NativeArguments args) {
+ int64_t current_rss = Process::CurrentRSS();
+ if (current_rss < 0) {
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+ return;
+ }
+ Dart_SetIntegerReturnValue(args, current_rss);
+}
+
+
+void FUNCTION_NAME(ProcessInfo_MaxRSS)(Dart_NativeArguments args) {
+ int64_t max_rss = Process::MaxRSS();
+ if (max_rss < 0) {
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+ return;
+ }
+ Dart_SetIntegerReturnValue(args, max_rss);
+}
+
} // namespace bin
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698