summaryrefslogtreecommitdiffstats
path: root/src/common/memory_detect.cpp
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2020-07-01 00:55:47 +0200
committerJan Beich <jbeich@FreeBSD.org>2020-07-01 01:00:18 +0200
commit3b1683a152610b2da161ba3084e2dd5942127303 (patch)
tree5e0cf66851b8531f6e0ea6dc6c94d7726fcc5226 /src/common/memory_detect.cpp
parentcommon: add sysconf() fallback (diff)
downloadyuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar.gz
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar.bz2
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar.lz
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar.xz
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.tar.zst
yuzu-3b1683a152610b2da161ba3084e2dd5942127303.zip
Diffstat (limited to 'src/common/memory_detect.cpp')
-rw-r--r--src/common/memory_detect.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/memory_detect.cpp b/src/common/memory_detect.cpp
index e981b9a2a..8cff6ec37 100644
--- a/src/common/memory_detect.cpp
+++ b/src/common/memory_detect.cpp
@@ -40,16 +40,16 @@ static MemoryInfo Detect() {
// hw and vm are defined in sysctl.h
// https://github.com/apple/darwin-xnu/blob/master/bsd/sys/sysctl.h#L471
// 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);
+ sysctlbyname("hw.memsize", &ramsize, &sizeof_ramsize, nullptr, 0);
+ sysctlbyname("vm.swapusage", &vmusage, &sizeof_vmusage, nullptr, 0);
mem_info.TotalPhysicalMemory = ramsize;
mem_info.TotalSwapMemory = vmusage.xsu_total;
#elif defined(__FreeBSD__)
u_long physmem, swap_total;
std::size_t sizeof_u_long = sizeof(u_long);
// sysctlbyname(const char *, void *, size_t *, const void *, size_t);
- sysctlbyname("hw.physmem", &physmem, &sizeof_u_long, NULL, 0);
- sysctlbyname("vm.swap_total", &swap_total, &sizeof_u_long, NULL, 0);
+ sysctlbyname("hw.physmem", &physmem, &sizeof_u_long, nullptr, 0);
+ sysctlbyname("vm.swap_total", &swap_total, &sizeof_u_long, nullptr, 0);
mem_info.TotalPhysicalMemory = physmem;
mem_info.TotalSwapMemory = swap_total;
#elif defined(__linux__)