From 8c63883f1ff72191becfda8506e3919a50af20d8 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Tue, 17 Jun 2003 19:54:00 +0000 Subject: [PATCH] Put ifdefs around use of malloc.h/mallinfo, which isn't available on FreeBSD. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6750 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Timer.cpp | 7 +++++-- support/lib/Support/Timer.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp index 625653afe1a..26f10e77f77 100644 --- a/lib/Support/Timer.cpp +++ b/lib/Support/Timer.cpp @@ -10,7 +10,9 @@ #include #include #include +#ifndef __FreeBSD__ #include +#endif // __FreeBSD__ #include #include #include @@ -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 { diff --git a/support/lib/Support/Timer.cpp b/support/lib/Support/Timer.cpp index 625653afe1a..26f10e77f77 100644 --- a/support/lib/Support/Timer.cpp +++ b/support/lib/Support/Timer.cpp @@ -10,7 +10,9 @@ #include #include #include +#ifndef __FreeBSD__ #include +#endif // __FreeBSD__ #include #include #include @@ -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 {