[sanitizer] Implement GetRSS on Windows
Summary: Pretty straightforward, returning the `WorkingSetSize` of a `PROCESS_MEMORY_COUNTERS` structure. AFAIU, `GetProcessMemoryInfo` is in `kernel32.lib` for Windows 7 and above. Support for earlier Windows versions would require `psapi.lib`, but I don't think those are supported by ASan? Reviewers: alekseyshl, rnk, vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka, kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42822 llvm-svn: 325020
This commit is contained in:
parent
f73ff612ca
commit
1ce4642ddc
|
|
@ -763,7 +763,10 @@ uptr internal_ftruncate(fd_t fd, uptr size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uptr GetRSS() {
|
uptr GetRSS() {
|
||||||
return 0;
|
PROCESS_MEMORY_COUNTERS counters;
|
||||||
|
if (!GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters)))
|
||||||
|
return 0;
|
||||||
|
return counters.WorkingSetSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *internal_start_thread(void (*func)(void *arg), void *arg) { return 0; }
|
void *internal_start_thread(void (*func)(void *arg), void *arg) { return 0; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue