Index: runtime/vm/os_fuchsia.cc |
diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc |
index 209c825e5f1056a4e2892de27fe6060c99a9e9f1..74e965666f1aaa45b3f054d125779d3b905dd554 100644 |
--- a/runtime/vm/os_fuchsia.cc |
+++ b/runtime/vm/os_fuchsia.cc |
@@ -8,7 +8,9 @@ |
#include "vm/os.h" |
#include <errno.h> |
+#include <magenta/process.h> |
#include <magenta/syscalls.h> |
+#include <magenta/syscalls/object.h> |
#include <magenta/types.h> |
#include "platform/assert.h" |
@@ -156,8 +158,11 @@ int OS::NumberOfAvailableProcessors() { |
uintptr_t OS::MaxRSS() { |
- // TODO(US-95): Implement. |
- return 0; |
+ mx_info_task_stats_t task_stats; |
+ mx_handle_t process = mx_process_self(); |
+ mx_status_t status = mx_object_get_info( |
+ process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL); |
+ return (status == NO_ERROR) ? task_stats.mem_committed_bytes : 0; |
} |