1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:17:35 +00:00

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

View file

@ -27,7 +27,7 @@ index d285ed9..10fbd7f 100644
diff --git a/src/unix/serenity-core.c b/src/unix/serenity-core.c diff --git a/src/unix/serenity-core.c b/src/unix/serenity-core.c
new file mode 100644 new file mode 100644
index 0000000..4438d15 index 0000000..5c34b75
--- /dev/null --- /dev/null
+++ b/src/unix/serenity-core.c +++ b/src/unix/serenity-core.c
@@ -0,0 +1,112 @@ @@ -0,0 +1,112 @@
@ -85,12 +85,12 @@ index 0000000..4438d15
+} +}
+ +
+uint64_t uv_get_free_memory(void) { +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) { +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]) { +void uv_loadavg(double avg[3]) {