diff options
| author | Augustin Cavalier <waddlesplash@gmail.com> | 2017-02-22 12:21:10 -0500 |
|---|---|---|
| committer | Augustin Cavalier <waddlesplash@gmail.com> | 2017-03-27 23:46:19 -0400 |
| commit | 0831dad467374f11256b5e63ca66b9dff5bf2463 (patch) | |
| tree | 4c4db3771b5fa0c9da6221f84a1057334d042bb3 /Source/Core/Common/MemoryUtil.cpp | |
| parent | 7304cb0f8eb55169f7f601444a1733020fd96e15 (diff) | |
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); |
