Skip to content

Commit

Permalink
Use GlobalMemoryStatusEx for low mem check
Browse files Browse the repository at this point in the history
  • Loading branch information
ensiform committed Oct 4, 2018
1 parent 200c169 commit 6c130fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/win32/win_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ Sys_LowPhysicalMemory
==================
*/
qboolean Sys_LowPhysicalMemory( void ) {
MEMORYSTATUS stat;
GlobalMemoryStatus( &stat );
return (stat.dwTotalPhys <= MEM_THRESHOLD) ? qtrue : qfalse;
MEMORYSTATUSEX statex;
statex.dwLength = sizeof( statex );

GlobalMemoryStatusEx( &statex );
return (statex.ullTotalPhys <= MEM_THRESHOLD) ? qtrue : qfalse;
}

/*
Expand Down

0 comments on commit 6c130fe

Please sign in to comment.