Lines 49-54
Link Here
|
49 |
#include <X11/Xlib.h> |
49 |
#include <X11/Xlib.h> |
50 |
#include <X11/extensions/Xrender.h> |
50 |
#include <X11/extensions/Xrender.h> |
51 |
|
51 |
|
|
|
52 |
#ifndef _SC_PHYS_PAGES |
53 |
#include <sys/param.h> |
54 |
#include <sys/sysctl.h> |
55 |
#endif |
56 |
|
52 |
Display* dpy = 0; |
57 |
Display* dpy = 0; |
53 |
Colormap colormap = 0; |
58 |
Colormap colormap = 0; |
54 |
Visual *visual = 0; |
59 |
Visual *visual = 0; |
Lines 139-146
Link Here
|
139 |
cacheSize += cacheSize / 10; |
144 |
cacheSize += cacheSize / 10; |
140 |
|
145 |
|
141 |
// Calculate the size of physical system memory |
146 |
// Calculate the size of physical system memory |
142 |
int memorySize = sysconf(_SC_PHYS_PAGES); |
147 |
#ifdef _SC_PHYS_PAGES |
143 |
memorySize *= sysconf(_SC_PAGESIZE) / 1024; |
148 |
int memorySize = sysconf(_SC_PHYS_PAGES); |
|
|
149 |
memorySize *= sysconf(_SC_PAGESIZE) / 1024; |
150 |
#else |
151 |
size_t memorySize; |
152 |
size_t len; |
153 |
static int mib[]={ CTL_HW, HW_PHYSMEM }; |
154 |
|
155 |
len = sizeof(memorySize); |
156 |
sysctl(mib, 2, &memorySize, &len, NULL, 0); |
157 |
memorySize /= 1024; |
158 |
#endif |
144 |
|
159 |
|
145 |
// Increase the pixmap cache size to 1% of system memory if it isn't already |
160 |
// Increase the pixmap cache size to 1% of system memory if it isn't already |
146 |
// larger so as to maximize cache usage. 1% of 1GB ~= 10MB. |
161 |
// larger so as to maximize cache usage. 1% of 1GB ~= 10MB. |