From 47fe9469dbf40c3fc0f93ded6825ab4405357fab Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 16 Jan 2010 20:40:15 -0300 Subject: [PATCH] Remove commented out code --- gc/alloc.d | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gc/alloc.d b/gc/alloc.d index 55d0497..6fd156e 100644 --- a/gc/alloc.d +++ b/gc/alloc.d @@ -79,19 +79,7 @@ private extern (C) { } } -/+ -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. @@ -140,7 +128,7 @@ static if (is(typeof(VirtualAlloc))) // version (GC_Use_Alloc_Win32) 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; @@ -167,7 +155,7 @@ else static if (is(typeof(mmap))) // else version (GC_Use_Alloc_MMap) 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) { @@ -193,7 +181,7 @@ else static if (is(typeof(valloc))) // else version (GC_Use_Alloc_Valloc) 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 -- 2.43.0