mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-04-16 21:46:03 +02:00
Initialize MEMORYSTATUSEX size before GlobalMemoryStatusEx() (thanks, Justin!).
Fixes Bugzilla #2177.
This commit is contained in:
parent
51fc4b202e
commit
72de99aed3
@ -642,6 +642,7 @@ SDL_GetSystemRAM(void)
|
|||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
if (SDL_SystemRAM <= 0) {
|
if (SDL_SystemRAM <= 0) {
|
||||||
MEMORYSTATUSEX stat;
|
MEMORYSTATUSEX stat;
|
||||||
|
stat.dwLength = sizeof(stat);
|
||||||
if (GlobalMemoryStatusEx(&stat)) {
|
if (GlobalMemoryStatusEx(&stat)) {
|
||||||
SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
|
SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user