diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-20 16:06:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-20 16:06:44 +0000 |
commit | 1cf74cee2105efefc043ddb80051fe9f8db4b82f (patch) | |
tree | 7632ff1706148cd5fa7ed5658f816267a70d471b /llvm/lib/System/Unix/Process.cpp | |
parent | 1e10203375744df816783fad39218efb07f759c1 (diff) | |
download | bcm5719-llvm-1cf74cee2105efefc043ddb80051fe9f8db4b82f.tar.gz bcm5719-llvm-1cf74cee2105efefc043ddb80051fe9f8db4b82f.zip |
Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
llvm-svn: 19071
Diffstat (limited to 'llvm/lib/System/Unix/Process.cpp')
-rw-r--r-- | llvm/lib/System/Unix/Process.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/System/Unix/Process.cpp b/llvm/lib/System/Unix/Process.cpp index 654390432d4..c9507cb4e7b 100644 --- a/llvm/lib/System/Unix/Process.cpp +++ b/llvm/lib/System/Unix/Process.cpp @@ -50,11 +50,11 @@ static char* som = reinterpret_cast<char*>(::sbrk(0)); uint64_t Process::GetMallocUsage() { -#ifdef HAVE_MALLINFO +#if defined(HAVE_MALLINFO) struct mallinfo mi; mi = ::mallinfo(); return mi.uordblks; -#elif HAVE_SBRK +#elif defined(HAVE_SBRK) // Note this is only an approximation and more closely resembles // the value returned by mallinfo in the arena field. char * eom = sbrk(0); @@ -71,7 +71,7 @@ Process::GetMallocUsage() uint64_t Process::GetTotalMemoryUsage() { -#ifdef HAVE_MALLINFO +#if defined(HAVE_MALLINFO) struct mallinfo mi = ::mallinfo(); return mi.uordblks + mi.hblkhd; #else @@ -85,7 +85,7 @@ Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time, TimeValue& sys_time) { elapsed = TimeValue::now(); -#ifdef HAVE_GETRUSAGE +#if defined(HAVE_GETRUSAGE) struct rusage usage; ::getrusage(RUSAGE_SELF, &usage); user_time.seconds( usage.ru_utime.tv_sec ); |