summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-05-27 17:21:59 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-05-27 17:21:59 +0200
commitb2af3049185567dfb48aab18957221198c8eab09 (patch)
treefe6794672dd5fb3001c44810674e4179b8c0b208
parentmain: Log host system memory parameters (diff)
downloadyuzu-b2af3049185567dfb48aab18957221198c8eab09.tar
yuzu-b2af3049185567dfb48aab18957221198c8eab09.tar.gz
yuzu-b2af3049185567dfb48aab18957221198c8eab09.tar.bz2
yuzu-b2af3049185567dfb48aab18957221198c8eab09.tar.lz
yuzu-b2af3049185567dfb48aab18957221198c8eab09.tar.xz
yuzu-b2af3049185567dfb48aab18957221198c8eab09.tar.zst
yuzu-b2af3049185567dfb48aab18957221198c8eab09.zip
-rw-r--r--src/common/memory_detect.cpp7
-rw-r--r--src/yuzu/main.cpp2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/common/memory_detect.cpp b/src/common/memory_detect.cpp
index b59a45d55..3fdc309a2 100644
--- a/src/common/memory_detect.cpp
+++ b/src/common/memory_detect.cpp
@@ -33,10 +33,13 @@ static MemoryInfo Detect() {
#elif defined(__APPLE__)
u64 ramsize;
struct xsw_usage vmusage;
+ std::size_t sizeof_ramsize = sizeof(ramsize);
+ std::size_t sizeof_vmusage = sizeof(vmusage);
// hw and vm are defined in sysctl.h
// https://github.com/apple/darwin-xnu/blob/master/bsd/sys/sysctl.h#L471
- sysctlbyname(hw.memsize, &ramsize, sizeof(ramsize), NULL, 0);
- sysctlbyname(vm.swapusage, &vmusage, sizeof(vmusage), NULL, 0);
+ // sysctlbyname(const char *, void *, size_t *, void *, size_t);
+ sysctlbyname("hw.memsize", &ramsize, &sizeof_ramsize, NULL, 0);
+ sysctlbyname("vm.swapusage", &vmusage, &sizeof_vmusage, NULL, 0);
mem_info.TotalPhysicalMemory = ramsize;
mem_info.TotalSwapMemory = vmusage.xsu_total;
#else
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f690a1508..270cccc77 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -222,7 +222,7 @@ GMainWindow::GMainWindow()
LOG_INFO(Frontend, "Host OS: {}", QSysInfo::prettyProductName().toStdString());
LOG_INFO(Frontend, "Host RAM: {:.2f} GB",
Common::GetMemInfo().TotalPhysicalMemory / 1024.0f / 1024 / 1024);
- LOG_INFO(Frontend, "Host Swapfile: {:.2f} GB",
+ LOG_INFO(Frontend, "Host Swap: {:.2f} GB",
Common::GetMemInfo().TotalSwapMemory / 1024.0f / 1024 / 1024);
UpdateWindowTitle();