diff --git a/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp b/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp index abbaeda..6b4beb2 100644 --- a/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp +++ b/toonz/sources/toonzfarm/tfarmserver/tfarmserver.cpp @@ -49,6 +49,10 @@ using namespace std; #include //To retrieve MAC HW infos #endif +#ifdef LINUX +#include //For getting total memory +#endif + // forward declaration class FarmServer; @@ -693,8 +697,10 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo) hwInfo.m_type = Irix; #else - int mib[2]; TINT64 physMemSize; + +#ifdef MACOSX + int mib[2]; size_t len; mib[0] = CTL_HW; @@ -702,6 +708,14 @@ void FarmServer::queryHwInfo(HwInfo &hwInfo) len = sizeof(physMemSize); sysctl(mib, 2, &physMemSize, &len, NULL, 0); +#elif defined(LINUX) + physMemSize = (TINT64)sysconf(_SC_PHYS_PAGES) * (TINT64)sysconf(_SC_PAGE_SIZE); + +#else +#warning "Unsupported platform!" + physMemSize = 500000000; +#endif + hwInfo.m_cpuCount = TSystem::getProcessorCount(); //We can just retrieve the overall physical memory - the rest is defaulted to 500 MB