aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArthur Miller2025-01-21 19:10:14 +0100
committerEli Zaretskii2025-01-21 21:22:58 +0200
commit58d3d4820ad327f07cea5894a9675bf30553461e (patch)
tree3d86788d740a9de504893d8fc91d71c4ff759eb7 /src
parent77386412050fa348940bf83c5d736ff7b745d5d8 (diff)
downloademacs-58d3d4820ad327f07cea5894a9675bf30553461e.tar.gz
emacs-58d3d4820ad327f07cea5894a9675bf30553461e.zip
Fix bug in w32_memory_info
* src/w32.c (w32_memory_info): Initialize struct size.
Diffstat (limited to 'src')
-rw-r--r--src/w32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/w32.c b/src/w32.c
index 6399d883544..0d876951cf6 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -7659,7 +7659,7 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram,
7659{ 7659{
7660 MEMORYSTATUS memst; 7660 MEMORYSTATUS memst;
7661 MEMORY_STATUS_EX memstex; 7661 MEMORY_STATUS_EX memstex;
7662 7662 memstex.dwLength = sizeof(memstex);
7663 /* Use GlobalMemoryStatusEx if available, as it can report more than 7663 /* Use GlobalMemoryStatusEx if available, as it can report more than
7664 2GB of memory. */ 7664 2GB of memory. */
7665 if (global_memory_status_ex (&memstex)) 7665 if (global_memory_status_ex (&memstex))
@@ -7670,7 +7670,9 @@ w32_memory_info (unsigned long long *totalram, unsigned long long *freeram,
7670 *freeswap = memstex.ullAvailPageFile; 7670 *freeswap = memstex.ullAvailPageFile;
7671 return 0; 7671 return 0;
7672 } 7672 }
7673 else if (global_memory_status (&memst)) 7673
7674 memst.dwLength = sizeof(memst);
7675 if (global_memory_status (&memst))
7674 { 7676 {
7675 *totalram = memst.dwTotalPhys; 7677 *totalram = memst.dwTotalPhys;
7676 *freeram = memst.dwAvailPhys; 7678 *freeram = memst.dwAvailPhys;