Put memory counter stuff in #ifdef _WIN32.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21181 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
1d923219fe
commit
09da79e190
@ -253,7 +253,10 @@ bool CompileFile(const char *fileName, ShHandle compiler, int debugOptions, cons
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
char **data = ReadFileData(fileName);
|
char **data = ReadFileData(fileName);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
PROCESS_MEMORY_COUNTERS counters; // just for memory leak testing
|
PROCESS_MEMORY_COUNTERS counters; // just for memory leak testing
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return false;
|
return false;
|
||||||
@ -262,10 +265,12 @@ bool CompileFile(const char *fileName, ShHandle compiler, int debugOptions, cons
|
|||||||
for (int j = 0; j < ((debugOptions & EDebugOpMemoryLeakMode) ? 100 : 1); ++j)
|
for (int j = 0; j < ((debugOptions & EDebugOpMemoryLeakMode) ? 100 : 1); ++j)
|
||||||
ret = ShCompile(compiler, data, OutputMultipleStrings, EShOptNone, resources, debugOptions, 100, false, EShMsgDefault);
|
ret = ShCompile(compiler, data, OutputMultipleStrings, EShOptNone, resources, debugOptions, 100, false, EShMsgDefault);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
if (debugOptions & EDebugOpMemoryLeakMode) {
|
if (debugOptions & EDebugOpMemoryLeakMode) {
|
||||||
GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters));
|
GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters));
|
||||||
printf("Working set size: %d\n", counters.WorkingSetSize);
|
printf("Working set size: %d\n", counters.WorkingSetSize);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeFileData(data);
|
FreeFileData(data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user