Skip to content
Snippets Groups Projects
Commit fac62cc3 authored by Soeren Peters's avatar Soeren Peters
Browse files

Merge pull request 'MemoryUtil can determine total physical memory on macOS'...

Merge pull request 'MemoryUtil can determine total physical memory on macOS' (#25) from marcus/VirtualFluids_dev:feature/memoryutil-macos into develop
parents 9507a6ff a979705a
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,13 @@ namespace Utilities
long long totalPhysMem = memInfo.totalram;
//Multiply in next statement to avoid int overflow on right hand side...
totalPhysMem *= memInfo.mem_unit;
#elif defined(MEMORYUTIL_APPLE)
long long totalPhysMem = 0;
#elif defined(MEMORYUTIL_APPLE)
int mib [] = { CTL_HW, HW_MEMSIZE };
int64_t totalPhysMem;
size_t length = sizeof(totalPhysMem);
if(sysctl(mib, 2, &totalPhysMem, &length, nullptr, 0) == -1)
return 0;
#else
#error "MemoryUtil::getTotalPhysMem - UnknownMachine"
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment