26 |
|
|
27 |
#if defined(WIN32) |
#if defined(WIN32) |
28 |
// require at least Windows 2000 for the GlobalMemoryStatusEx() call |
// require at least Windows 2000 for the GlobalMemoryStatusEx() call |
29 |
|
#if _WIN32_WINNT < 0x0500 |
30 |
|
#ifdef _WIN32_WINNT |
31 |
|
#undef _WIN32_WINNT |
32 |
|
#endif |
33 |
#define _WIN32_WINNT 0x0500 |
#define _WIN32_WINNT 0x0500 |
34 |
#endif |
#endif |
35 |
|
#endif |
36 |
|
|
37 |
#include "Sampler.h" |
#include "Sampler.h" |
38 |
#include "common/global_private.h" |
#include "common/global_private.h" |
119 |
dmsg(1,("Copyright (C) 2005-2009 Christian Schoenebeck\n")); |
dmsg(1,("Copyright (C) 2005-2009 Christian Schoenebeck\n")); |
120 |
|
|
121 |
#if defined(WIN32) |
#if defined(WIN32) |
122 |
|
#if 0 |
123 |
// some WIN32 memory info code which tries to determine the maximum lockable amount of memory (for debug purposes) |
// some WIN32 memory info code which tries to determine the maximum lockable amount of memory (for debug purposes) |
124 |
SYSTEM_INFO siSysInfo; |
SYSTEM_INFO siSysInfo; |
125 |
long physical_memory; |
long physical_memory; |
126 |
GetSystemInfo(&siSysInfo); |
GetSystemInfo(&siSysInfo); |
127 |
dmsg(1,("page size=%d\n", siSysInfo.dwPageSize)); |
dmsg(2,("page size=%d\n", siSysInfo.dwPageSize)); |
128 |
|
|
129 |
MEMORYSTATUSEX statex; |
MEMORYSTATUSEX statex; |
130 |
statex.dwLength = sizeof (statex); |
statex.dwLength = sizeof (statex); |
131 |
GlobalMemoryStatusEx (&statex); |
GlobalMemoryStatusEx (&statex); |
132 |
dmsg(1, ("There are %*I64d total Kbytes of physical memory.\n", |
dmsg(2, ("There are %*I64d total Kbytes of physical memory.\n", |
133 |
8, statex.ullTotalPhys)); |
8, statex.ullTotalPhys)); |
134 |
dmsg(1, ("There are %*I64d free Kbytes of physical memory.\n", |
dmsg(2, ("There are %*I64d free Kbytes of physical memory.\n", |
135 |
8, statex.ullAvailPhys)); |
8, statex.ullAvailPhys)); |
136 |
physical_memory = statex.ullTotalPhys; |
physical_memory = statex.ullTotalPhys; |
137 |
|
|
164 |
if(RequestedMinimumWorkingSetSize < DefaultMinimumWorkingSetSize) break; |
if(RequestedMinimumWorkingSetSize < DefaultMinimumWorkingSetSize) break; |
165 |
} |
} |
166 |
|
|
167 |
dmsg(1,("AFTER GetProcessWorkingSetSize: res = %d MinimumWorkingSetSize=%d, MaximumWorkingSetSize=%d\n", res,MinimumWorkingSetSize, MaximumWorkingSetSize)); |
dmsg(2,("AFTER GetProcessWorkingSetSize: res = %d MinimumWorkingSetSize=%d, MaximumWorkingSetSize=%d\n", res,MinimumWorkingSetSize, MaximumWorkingSetSize)); |
168 |
|
#endif |
169 |
#endif // WIN32 |
#endif // WIN32 |
170 |
|
|
171 |
if (tune) { |
if (tune) { |