Fix rusage memory reporting on NT

This issue was caused by c23b6ecc3 a few days ago, where we started
polling that information for the first time.
This commit is contained in:
Justine Tunney 2022-03-31 17:07:22 -07:00
parent 27bc49034c
commit 1ff1854107
4 changed files with 111 additions and 44 deletions

View file

@ -108,7 +108,7 @@ textwindows int sys_wait4_nt(int pid, int *opt_out_wstatus, int options,
if (opt_out_rusage) {
bzero(opt_out_rusage, sizeof(*opt_out_rusage));
if (GetProcessMemoryInfo(handles[i], &memcount, sizeof(memcount))) {
opt_out_rusage->ru_maxrss = memcount.PeakWorkingSetSize;
opt_out_rusage->ru_maxrss = memcount.PeakWorkingSetSize / 1024;
opt_out_rusage->ru_majflt = memcount.PageFaultCount;
} else {
STRACE("%s failed %u", "GetProcessMemoryInfo", GetLastError());