summaryrefslogtreecommitdiff
path: root/Source/Core/Common/MemoryUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/MemoryUtil.cpp')
-rw-r--r--Source/Core/Common/MemoryUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp
index 5ce39e1052..4eb2e1f2d3 100644
--- a/Source/Core/Common/MemoryUtil.cpp
+++ b/Source/Core/Common/MemoryUtil.cpp
@@ -22,6 +22,8 @@
#include <sys/types.h>
#if defined __APPLE__ || defined __FreeBSD__ || defined __OpenBSD__
#include <sys/sysctl.h>
+#elif defined __HAIKU__
+#include <OS.h>
#else
#include <sys/sysinfo.h>
#endif
@@ -269,6 +271,10 @@ size_t MemPhysical()
size_t length = sizeof(size_t);
sysctl(mib, 2, &physical_memory, &length, NULL, 0);
return physical_memory;
+#elif defined __HAIKU__
+ system_info sysinfo;
+ get_system_info(&sysinfo);
+ return static_cast<size_t>(sysinfo.max_pages * B_PAGE_SIZE);
#else
struct sysinfo memInfo;
sysinfo(&memInfo);