Put ifdefs around use of malloc.h/mallinfo, which isn't available on FreeBSD.
authorBrian Gaeke <gaeke@uiuc.edu>
Tue, 17 Jun 2003 19:54:00 +0000 (19:54 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Tue, 17 Jun 2003 19:54:00 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6750 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Timer.cpp
support/lib/Support/Timer.cpp

index 625653afe1aa75d2fc6279b1551097a7913e7a05..26f10e77f77a546f47d88a7aee267160097a856a 100644 (file)
@@ -10,7 +10,9 @@
 #include <sys/time.h>
 #include <sys/unistd.h>
 #include <unistd.h>
+#ifndef __FreeBSD__
 #include <malloc.h>
+#endif // __FreeBSD__
 #include <stdio.h>
 #include <iostream>
 #include <algorithm>
@@ -75,12 +77,13 @@ Timer::~Timer() {
 }
 
 static long getMemUsage() {
+#ifndef __FreeBSD__
   if (TrackSpace) {
     struct mallinfo MI = mallinfo();
     return MI.uordblks/*+MI.hblkhd*/;
-  } else {
-    return 0;
   }
+#endif // __FreeBSD__
+  return 0;
 }
 
 struct TimeRecord {
index 625653afe1aa75d2fc6279b1551097a7913e7a05..26f10e77f77a546f47d88a7aee267160097a856a 100644 (file)
@@ -10,7 +10,9 @@
 #include <sys/time.h>
 #include <sys/unistd.h>
 #include <unistd.h>
+#ifndef __FreeBSD__
 #include <malloc.h>
+#endif // __FreeBSD__
 #include <stdio.h>
 #include <iostream>
 #include <algorithm>
@@ -75,12 +77,13 @@ Timer::~Timer() {
 }
 
 static long getMemUsage() {
+#ifndef __FreeBSD__
   if (TrackSpace) {
     struct mallinfo MI = mallinfo();
     return MI.uordblks/*+MI.hblkhd*/;
-  } else {
-    return 0;
   }
+#endif // __FreeBSD__
+  return 0;
 }
 
 struct TimeRecord {