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

Unified Diff: runtime/bin/process_patch.dart

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
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | runtime/bin/process_unsupported.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_patch.dart
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 03c0462f2b9b85fda3f5cde74549b09ce2e31331..a4bd45135993bca68f99b1a1f6c682e10fe2702a 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -165,6 +165,30 @@ class _ProcessUtils {
}
}
+@patch
+class ProcessInfo {
+ @patch
+ static int get maxRss {
+ var result = _maxRss();
Vyacheslav Egorov (Google) 2017/04/18 16:02:04 This code looks bizarre - why is _maxRss simply no
zra 2017/04/18 16:07:17 Two reasons: 1. Calling Dart_ThrowException and D
Vyacheslav Egorov (Google) 2017/04/18 16:21:17 longjmp and setjmp are dangerous indeed[*] - never
zra 2017/04/18 16:33:58 Slava, you make some valid points, but: 1. I don't
+ if (result is OSError) {
+ throw result;
+ }
+ return result;
+ }
+
+ @patch
+ static int get currentRss {
+ var result = _currentRss();
+ if (result is OSError) {
+ throw result;
+ }
+ return result;
+ }
+
+ static _maxRss() native "ProcessInfo_MaxRSS";
+ static _currentRss() native "ProcessInfo_CurrentRSS";
+}
+
class _ProcessStartStatus {
int _errorCode; // Set to OS error code if process start failed.
String _errorMessage; // Set to OS error message if process start failed.
« no previous file with comments | « runtime/bin/process_macos.cc ('k') | runtime/bin/process_unsupported.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698