summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-06-17 19:54:00 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-06-17 19:54:00 +0000
commitad3aabd47a6b9d3dee4628e067f72ac8a464c051 (patch)
treea99c81055ae093190e3b3dc7c9ed350d718d93e3 /llvm/lib/Support/Timer.cpp
parentce5ee39319a1cb6ec78ee1e00a57cf69b901a32d (diff)
downloadbcm5719-llvm-ad3aabd47a6b9d3dee4628e067f72ac8a464c051.tar.gz
bcm5719-llvm-ad3aabd47a6b9d3dee4628e067f72ac8a464c051.zip
Put ifdefs around use of malloc.h/mallinfo, which isn't available on FreeBSD.
llvm-svn: 6750
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r--llvm/lib/Support/Timer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index 625653afe1a..26f10e77f77 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -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 {
OpenPOWER on IntegriCloud