[llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp
Reid Spencer
reid at x10sys.com
Mon Dec 20 08:06:55 PST 2004
Changes in directory llvm/lib/System/Unix:
Process.cpp updated: 1.2 -> 1.3
---
Log message:
Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
---
Diffs of the changes: (+4 -4)
Index: llvm/lib/System/Unix/Process.cpp
diff -u llvm/lib/System/Unix/Process.cpp:1.2 llvm/lib/System/Unix/Process.cpp:1.3
--- llvm/lib/System/Unix/Process.cpp:1.2 Sun Dec 19 18:59:28 2004
+++ llvm/lib/System/Unix/Process.cpp Mon Dec 20 10:06:44 2004
@@ -50,11 +50,11 @@
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 @@
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 @@
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 );
More information about the llvm-commits
mailing list