mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
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
This commit is contained in:
parent
ad110d2bb4
commit
8c63883f1f
@ -10,7 +10,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifndef __FreeBSD__
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -75,12 +77,13 @@ Timer::~Timer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static long getMemUsage() {
|
static long getMemUsage() {
|
||||||
|
#ifndef __FreeBSD__
|
||||||
if (TrackSpace) {
|
if (TrackSpace) {
|
||||||
struct mallinfo MI = mallinfo();
|
struct mallinfo MI = mallinfo();
|
||||||
return MI.uordblks/*+MI.hblkhd*/;
|
return MI.uordblks/*+MI.hblkhd*/;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
#endif // __FreeBSD__
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TimeRecord {
|
struct TimeRecord {
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifndef __FreeBSD__
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif // __FreeBSD__
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -75,12 +77,13 @@ Timer::~Timer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static long getMemUsage() {
|
static long getMemUsage() {
|
||||||
|
#ifndef __FreeBSD__
|
||||||
if (TrackSpace) {
|
if (TrackSpace) {
|
||||||
struct mallinfo MI = mallinfo();
|
struct mallinfo MI = mallinfo();
|
||||||
return MI.uordblks/*+MI.hblkhd*/;
|
return MI.uordblks/*+MI.hblkhd*/;
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
#endif // __FreeBSD__
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TimeRecord {
|
struct TimeRecord {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user