diff dmd/TypeDelegate.d @ 176:fa9a71a9f5a8

Moved all the mutable globals to Global
author korDen
date Sun, 10 Oct 2010 05:22:45 +0400
parents af724d3510d7
children e3afd1303184
line wrap: on
line diff
--- a/dmd/TypeDelegate.d	Sun Oct 10 03:48:06 2010 +0400
+++ b/dmd/TypeDelegate.d	Sun Oct 10 05:22:45 2010 +0400
@@ -136,6 +136,7 @@
 	version (LOGDOTEXP) {
 		printf("TypeDelegate.dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars());
 	}
+		auto tvoidptr = global.tvoidptr;
 		if (ident == Id.ptr)
 		{
 			e.type = tvoidptr;
@@ -170,8 +171,6 @@
 	}
 }
 
-	static __gshared Symbol* s;
-
     override type* toCtype()
 	{
 		type* t;
@@ -185,9 +184,10 @@
 			 *    _Delegate { void* frameptr; Function *funcptr; }
 			 */
 
+			auto s = global.Delegate_s;
 			if (!s)
 			{
-				s = symbol_calloc("_Delegate");
+				global.Delegate_s = s = symbol_calloc("_Delegate");
 				s.Sclass = SC.SCstruct;
 				s.Sstruct = struct_calloc();
 				s.Sstruct.Sflags |= 0;	/// huh?
@@ -196,11 +196,13 @@
 				s.Sstruct.Sstructsize = cast(uint)size(Loc(0));
 				slist_add(s);
 
-				Symbol* s1 = symbol_name("frameptr", SC.SCmember, Type.tvoidptr.toCtype());
+				auto tvoidptr = global.tvoidptr;
+				
+				Symbol* s1 = symbol_name("frameptr", SC.SCmember, tvoidptr.toCtype());
 				list_append(&s.Sstruct.Sfldlst, s1);
 
-				Symbol* s2 = symbol_name("funcptr", SC.SCmember, Type.tvoidptr.toCtype());
-				s2.Smemoff = cast(uint)Type.tvoidptr.size();
+				Symbol* s2 = symbol_name("funcptr", SC.SCmember, tvoidptr.toCtype());
+				s2.Smemoff = cast(uint)tvoidptr.size();
 				list_append(&s.Sstruct.Sfldlst, s2);
 			}