--- plasma-4.0.1/plasma/plasma/plasmaapp.cpp 2008-02-21 10:57:28 +0100 +++ plasma-4.0.1/plasma/plasma/plasmaapp.cpp 2008-02-21 11:00:40 +0100 @@ -49,6 +49,11 @@ #include #include +#ifndef _SC_PHYS_PAGES +#include +#include +#endif + Display* dpy = 0; Colormap colormap = 0; Visual *visual = 0; @@ -139,8 +144,18 @@ cacheSize += cacheSize / 10; // Calculate the size of physical system memory - int memorySize = sysconf(_SC_PHYS_PAGES); - memorySize *= sysconf(_SC_PAGESIZE) / 1024; +#ifdef _SC_PHYS_PAGES + int memorySize = sysconf(_SC_PHYS_PAGES); + memorySize *= sysconf(_SC_PAGESIZE) / 1024; +#else + size_t memorySize; + size_t len; + static int mib[]={ CTL_HW, HW_PHYSMEM }; + + len = sizeof(memorySize); + sysctl(mib, 2, &memorySize, &len, NULL, 0); + memorySize /= 1024; +#endif // Increase the pixmap cache size to 1% of system memory if it isn't already // larger so as to maximize cache usage. 1% of 1GB ~= 10MB.