From 6b86d8a44d7855bbf5bc4a9dc6eb9107831ef135 Mon Sep 17 00:00:00 2001 From: stasoid Date: Sat, 21 Dec 2024 11:44:55 +0500 Subject: [PATCH] LibCore: Implement System::physical_memory_bytes on Windows --- Libraries/LibCore/SystemWindows.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/LibCore/SystemWindows.cpp b/Libraries/LibCore/SystemWindows.cpp index 2973e1fd22f..5d6a0a19302 100644 --- a/Libraries/LibCore/SystemWindows.cpp +++ b/Libraries/LibCore/SystemWindows.cpp @@ -239,4 +239,12 @@ unsigned hardware_concurrency() return si.dwNumberOfProcessors; } +u64 physical_memory_bytes() +{ + MEMORYSTATUSEX ms = {}; + ms.dwLength = sizeof ms; + GlobalMemoryStatusEx(&ms); + return ms.ullTotalPhys; +} + }