diff options
| author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:17 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:17 +0300 |
| commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
| tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/system/rusage.cpp | |
| parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system/rusage.cpp')
| -rw-r--r-- | util/system/rusage.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/rusage.cpp b/util/system/rusage.cpp index 19d13d6c19f..2befeca8755 100644 --- a/util/system/rusage.cpp +++ b/util/system/rusage.cpp @@ -1,20 +1,20 @@ -#include "platform.h" +#include "platform.h" #if defined(__APPLE__) && defined(__MACH__) - #include <mach/mach.h> + #include <mach/mach.h> #endif #ifdef _win_ - #include "winint.h" - #include <psapi.h> + #include "winint.h" + #include <psapi.h> #else - #include <sys/time.h> - #include <sys/resource.h> + #include <sys/time.h> + #include <sys/resource.h> #endif @@ -26,10 +26,10 @@ #ifdef _win_ TDuration FiletimeToDuration(const FILETIME& ft) { - union { - ui64 ft_scalar; - FILETIME ft_struct; - } nt_time; + union { + ui64 ft_scalar; + FILETIME ft_struct; + } nt_time; nt_time.ft_struct = ft; return TDuration::MicroSeconds(nt_time.ft_scalar / 10); } @@ -59,9 +59,9 @@ size_t TRusage::GetCurrentRSS() { /* Linux ---------------------------------------------------- */ long rss = 0L; FILE* fp = nullptr; - if ((fp = fopen("/proc/self/statm", "r")) == nullptr) { + if ((fp = fopen("/proc/self/statm", "r")) == nullptr) { return (size_t)0L; /* Can't open? */ - } + } if (fscanf(fp, "%*s%ld", &rss) != 1) { fclose(fp); return (size_t)0L; /* Can't read? */ @@ -108,12 +108,12 @@ void TRusage::Fill() { ythrow TSystemError() << "rusage failed"; } - #if defined(_darwin_) + #if defined(_darwin_) // see https://lists.apple.com/archives/darwin-kernel/2009/Mar/msg00005.html MaxRss = ru.ru_maxrss; - #else + #else MaxRss = ru.ru_maxrss * 1024LL; - #endif + #endif MajorPageFaults = ru.ru_majflt; Utime = ru.ru_utime; Stime = ru.ru_stime; |
