1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

Make mmap's fd for anonymous memory acquisition default to -1, except on

Linux. This is consistent with what FreeBSD and Solaris both want.
This makes the JIT work on FreeBSD 5.1-RELEASE. Whee.

llvm-svn: 9045
This commit is contained in:
Brian Gaeke 2003-10-11 03:51:18 +00:00
parent 4fba6f8089
commit 143f9b5000

View File

@ -56,13 +56,18 @@ static void *getMemory(unsigned NumBytes) {
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
# define MAP_ANONYMOUS MAP_ANON
#endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */
#define fd 0
#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
#define fd -1
/* nothing */
#else
std::cerr << "This architecture is not supported by the JIT!\n";
abort();
#endif
#if defined(__linux__)
#define fd 0
#else
#define fd -1
#endif
unsigned mmapFlags = MAP_PRIVATE|MAP_ANONYMOUS;
#ifdef MAP_NORESERVE