mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-03 13:00:29 +00:00
Ports: Update libuv to use the right /proc/memstat values
This commit is contained in:
parent
7b7847c707
commit
e5de5f4cf3
Notes:
sideshowbarker
2024-07-17 08:56:47 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/e5de5f4cf3 Pull-request: https://github.com/SerenityOS/serenity/pull/14583
1 changed files with 3 additions and 3 deletions
|
@ -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]) {
|
||||
|
|
Loading…
Reference in a new issue