}
}
-/+
-static if(is(typeof(VirtualAlloc)))
- version = GC_Use_Alloc_Win32;
-else static if (is(typeof(mmap)))
- version = GC_Use_Alloc_MMap;
-else static if (is(typeof(valloc)))
- version = GC_Use_Alloc_Valloc;
-else static if (is(typeof(malloc)))
- version = GC_Use_Alloc_Malloc;
-else static assert(false, "No supported allocation methods available.");
-+/
-
-static if (is(typeof(VirtualAlloc))) // version (GC_Use_Alloc_Win32)
+static if (is(typeof(VirtualAlloc)))
{
/**
* Map memory.
return cast(int)(VirtualFree(base, 0, MEM_RELEASE) == 0);
}
}
-else static if (is(typeof(mmap))) // else version (GC_Use_Alloc_MMap)
+else static if (is(typeof(mmap)))
{
void *os_mem_map(size_t nbytes)
{ void *p;
return munmap(base, nbytes);
}
}
-else static if (is(typeof(valloc))) // else version (GC_Use_Alloc_Valloc)
+else static if (is(typeof(valloc)))
{
void *os_mem_map(size_t nbytes)
{
return 0;
}
}
-else static if (is(typeof(malloc))) // else version (GC_Use_Alloc_Malloc)
+else static if (is(typeof(malloc)))
{
// NOTE: This assumes malloc granularity is at least (void*).sizeof. If
// (req_size + PAGESIZE) is allocated, and the pointer is rounded up