Commit 6c343630 authored by Steffen Müthing's avatar Steffen Müthing

[DebugAllocator] Fix to work OS X < 10.11

OS X versions older than El Capitan (10.11) do not define MAP_ANONYMOUS,
but only MAP_ANON. On the other hand, MAP_ANON is deprecated on Linux.

So add a preprocesser switch to make both happy.
parent 24724433
......@@ -124,7 +124,12 @@ namespace Dune
size_type overlap = ai.capacity % page_size;
ai.page_ptr = mmap(NULL, ai.pages * page_size,
PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
#ifdef __APPLE__
MAP_ANON | MAP_PRIVATE,
#else
MAP_ANONYMOUS | MAP_PRIVATE,
#endif
-1, 0);
if (MAP_FAILED == ai.page_ptr)
{
throw std::bad_alloc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment