diff options
| author | Matthew Parlane <parlane@gmail.com> | 2017-03-28 17:19:35 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-28 17:19:35 +1300 |
| commit | 85d74a506f6e4024ae1ffdf857d68ebed96fa4a9 (patch) | |
| tree | 615c4104ef8ab87cdc6267b9f856140eab025aa8 /Source/Core/Common/MemoryUtil.cpp | |
| parent | 8c23888968cbc8b513c5b45df5014213ba356bc1 (diff) | |
| parent | 0831dad467374f11256b5e63ca66b9dff5bf2463 (diff) | |
Merge pull request #4951 from waddlesplash/haiku-2
Initial support for Haiku.
Diffstat (limited to 'Source/Core/Common/MemoryUtil.cpp')
| -rw-r--r-- | Source/Core/Common/MemoryUtil.cpp | 6 |
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); |
