1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[win32] Get free memory info

This commit is contained in:
Witold Filipczyk 2024-05-02 19:58:16 +02:00
parent f8d08d1db3
commit af85de2535
2 changed files with 11 additions and 1 deletions

View File

@ -74,7 +74,7 @@
#include "util/string.h" #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 long
os_get_free_mem_in_mib(void) os_get_free_mem_in_mib(void)
{ {

View File

@ -336,3 +336,13 @@ user_appdata_directory(void)
else else
return NULL; return NULL;
} }
long
os_get_free_mem_in_mib(void)
{
MEMORYSTATUSEX statex;
statex.dwLength = sizeof(statex);
GlobalMemoryStatusEx(&statex);
return statex.ullAvailPhys / (1024 * 1024);
}