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. |