diff dmd/TypeAArray.d @ 14:2cc604139636

Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
author Robert Clipsham <robert@octarineparrot.com>
date Sun, 04 Apr 2010 02:06:32 +0100
parents 10317f0c89a5
children b7d29f613539
line wrap: on
line diff
--- a/dmd/TypeAArray.d	Wed Mar 31 16:29:36 2010 +0400
+++ b/dmd/TypeAArray.d	Sun Apr 04 02:06:32 2010 +0100
@@ -35,7 +35,8 @@
 
 import core.stdc.stdio;
 import core.stdc.stdlib;
-
+version (Bug4054)
+	import core.memory;
 class TypeAArray : TypeArray
 {
     Type index;		// key type
@@ -311,6 +312,9 @@
 
 		sz = next.size();		// it's just data, so we only care about the size
 		sz = (sz + 3) & ~3;		// reduce proliferation of library routines
+		version (Bug4054)
+		id = cast(char*)GC.malloc(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1);
+		else
 		id = cast(char*)alloca(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1);
 		buf.writeByte(0);
 		if (flags & 1)
@@ -318,6 +322,9 @@
 		else
 			sprintf(id, "_aa%s%s", func, buf.data);
 	} else {
+		version (Bug4054)
+		id = cast(char*)GC.malloc(3 + strlen(func) + 1);
+		else
 		id = cast(char*)alloca(3 + strlen(func) + 1);
 		sprintf(id, "_aa%s", func);
 	}
@@ -357,4 +364,4 @@
 	{
 		assert(false);
 	}
-}
\ No newline at end of file
+}