diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-04 19:01:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-04 19:01:41 +0000 |
commit | 6cd11f6535600da5f286056748d4817e0f44b778 (patch) | |
tree | 04b6c2abb6fa640115ab41b33cb124fc4ae59cb2 /lib/Support/Timer.cpp | |
parent | 0188534cd1db5118a3dc0570be67c08dfcf957b2 (diff) |
mallinfo is not available on sun apparently :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Timer.cpp')
-rw-r--r-- | lib/Support/Timer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 45c2128a27..48b8f57c3f 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -71,13 +71,18 @@ static TimeRecord getTimeRecord() { perror("getrusage call failed: -time-passes info incorrect!"); } - struct mallinfo MI = mallinfo(); - TimeRecord Result; Result.Elapsed = T.tv_sec + T.tv_usec/1000000.0; Result.UserTime = RU.ru_utime.tv_sec + RU.ru_utime.tv_usec/1000000.0; Result.SystemTime = RU.ru_stime.tv_sec + RU.ru_stime.tv_usec/1000000.0; + +#ifndef __sparc__ + struct mallinfo MI = mallinfo(); Result.MaxRSS = MI.uordblks; +#else + Result.MaxRSS = 0; +#endif + return Result; } |