Ports: Update libuv to use the right /proc/memstat values

This commit is contained in:
Liav A 2022-07-14 15:34:08 +03:00 committed by Andreas Kling
parent 7b7847c707
commit e5de5f4cf3
Notes: sideshowbarker 2024-07-17 08:56:47 +09:00

View File

@ -27,7 +27,7 @@ index d285ed9..10fbd7f 100644
diff --git a/src/unix/serenity-core.c b/src/unix/serenity-core.c
new file mode 100644
index 0000000..4438d15
index 0000000..5c34b75
--- /dev/null
+++ b/src/unix/serenity-core.c
@@ -0,0 +1,112 @@
@ -85,12 +85,12 @@ index 0000000..4438d15
+}
+
+uint64_t uv_get_free_memory(void) {
+ return uv__read_proc_memstat("user_physical_available\":") * PAGE_SIZE;
+ return uv__read_proc_memstat("physical_available\":") * PAGE_SIZE;
+}
+
+
+uint64_t uv_get_total_memory(void) {
+ return (uv__read_proc_memstat("user_physical_allocated\":") + uv__read_proc_memstat("user_physical_available\":")) * PAGE_SIZE;
+ return (uv__read_proc_memstat("physical_allocated\":") + uv__read_proc_memstat("physical_available\":")) * PAGE_SIZE;
+}
+
+void uv_loadavg(double avg[3]) {