diff --git a/src/osdep/osdep.c b/src/osdep/osdep.c index 66778f01..c056916d 100644 --- a/src/osdep/osdep.c +++ b/src/osdep/osdep.c @@ -74,7 +74,7 @@ #include "util/string.h" -#if !defined(CONFIG_OS_DOS) && !defined(CONFIG_OS_UNIX) +#if !defined(CONFIG_OS_DOS) && !defined(CONFIG_OS_UNIX) && !defined(CONFIG_OS_WIN32) long os_get_free_mem_in_mib(void) { diff --git a/src/osdep/win32/win32.c b/src/osdep/win32/win32.c index aa27d1d7..7347e209 100644 --- a/src/osdep/win32/win32.c +++ b/src/osdep/win32/win32.c @@ -336,3 +336,13 @@ user_appdata_directory(void) else return NULL; } + +long +os_get_free_mem_in_mib(void) +{ + MEMORYSTATUSEX statex; + statex.dwLength = sizeof(statex); + GlobalMemoryStatusEx(&statex); + + return statex.ullAvailPhys / (1024 * 1024); +}