mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
util: Implement os_get_available_system_memory on Win32
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18001>
This commit is contained in:
parent
b2bf20e28f
commit
d85295e6a9
1 changed files with 8 additions and 0 deletions
|
|
@ -317,6 +317,14 @@ os_get_available_system_memory(uint64_t *size)
|
|||
|
||||
*size = MIN2(mem_available, rl.rlim_cur);
|
||||
return true;
|
||||
#elif DETECT_OS_WINDOWS
|
||||
MEMORYSTATUSEX status;
|
||||
BOOL ret;
|
||||
|
||||
status.dwLength = sizeof(status);
|
||||
ret = GlobalMemoryStatusEx(&status);
|
||||
*size = status.ullAvailPhys;
|
||||
return (ret == TRUE);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue