Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks,…
… Justin!).

Fixes Bugzilla #2177.
  • Loading branch information
icculus committed Oct 23, 2013
1 parent 51fc4b2 commit 72de99a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cpuinfo/SDL_cpuinfo.c
Expand Up @@ -642,6 +642,7 @@ SDL_GetSystemRAM(void)
#ifdef __WIN32__
if (SDL_SystemRAM <= 0) {
MEMORYSTATUSEX stat;
stat.dwLength = sizeof(stat);
if (GlobalMemoryStatusEx(&stat)) {
SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
}
Expand Down

0 comments on commit 72de99a

Please sign in to comment.