summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 05:21:16 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 05:21:16 +0000
commit2295d0b7deb9da2e8131e005e7da1c337bdaec3d (patch)
tree5caa820a248c0cb17590f110eb4cb2eacc103808
parenta7f83cf6b3cf2b2de8f7b0c13795938835b802cb (diff)
downloadbcm5719-llvm-2295d0b7deb9da2e8131e005e7da1c337bdaec3d.tar.gz
bcm5719-llvm-2295d0b7deb9da2e8131e005e7da1c337bdaec3d.zip
Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed. llvm-svn: 19904
-rw-r--r--llvm/include/llvm/Support/Timer.h4
-rw-r--r--llvm/lib/Support/Timer.cpp5
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 86194d16b6f..3af688c863f 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -36,7 +36,7 @@ class Timer {
double Elapsed; // Wall clock time elapsed in seconds
double UserTime; // User time elapsed
double SystemTime; // System time elapsed
- size_t MemUsed; // Memory allocated (in bytes)
+ ssize_t MemUsed; // Memory allocated (in bytes)
size_t PeakMem; // Peak memory used
size_t PeakMemBase; // Temporary for peak calculation...
std::string Name; // The name of this time variable
@@ -50,7 +50,7 @@ public:
double getProcessTime() const { return UserTime+SystemTime; }
double getWallTime() const { return Elapsed; }
- size_t getMemUsed() const { return MemUsed; }
+ ssize_t getMemUsed() const { return MemUsed; }
size_t getPeakMem() const { return PeakMem; }
std::string getName() const { return Name; }
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index bea81648efc..3713f7f69ca 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -19,7 +19,6 @@
#include <functional>
#include <iostream>
#include <map>
-
using namespace llvm;
// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
@@ -101,7 +100,7 @@ static inline size_t getMemUsage() {
struct TimeRecord {
double Elapsed, UserTime, SystemTime;
- size_t MemUsed;
+ ssize_t MemUsed;
};
static TimeRecord getTimeRecord(bool Start) {
@@ -111,7 +110,7 @@ static TimeRecord getTimeRecord(bool Start) {
sys::TimeValue user(0,0);
sys::TimeValue sys(0,0);
- size_t MemUsed = 0;
+ ssize_t MemUsed = 0;
if (Start) {
sys::Process::GetTimeUsage(now,user,sys);
MemUsed = getMemUsage();
OpenPOWER on IntegriCloud