Skip to content
Permalink
Browse files

Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks,…

… Justin!).

Fixes Bugzilla #2177.
  • Loading branch information
icculus committed Oct 23, 2013
1 parent 51fc4b2 commit 72de99aed31da6f4ed4ad3e319a5a91d58ab38b4
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/cpuinfo/SDL_cpuinfo.c
@@ -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));
}

0 comments on commit 72de99a

Please sign in to comment.