[Mono-devel-list] Re: [Mono-patches] r40228 - trunk/mcs/class/System.Drawing/System.Drawing

Marek Safar marek.safar at seznam.cz
Mon Feb 7 03:11:46 EST 2005


Hello Hari,

>Hi,
>
>"Ben Maurer <webmaster at theratnerschool.org>" <benm at mono-cvs.ximian.com> writes:
>
>[snip]
>  
>
>>2005-02-06  Ben Maurer  <bmaurer at ximian.com>
>>
>>	* Brushes.cs: Kill the static ctor here, it has tons of code bloat.
>>
>>Modified: trunk/mcs/class/System.Drawing/System.Drawing/Brushes.cs
>>===================================================================
>>--- trunk/mcs/class/System.Drawing/System.Drawing/Brushes.cs	2005-02-07 03:25:54 UTC (rev 40227)
>>+++ trunk/mcs/class/System.Drawing/System.Drawing/Brushes.cs	2005-02-07 03:35:53 UTC (rev 40228)
>>@@ -39,147 +39,147 @@
>> {
>> 	public sealed class Brushes 
>> 	{
>>-		private static SolidBrush aliceBlue = null;
>>-		private static SolidBrush antiqueWhite = null;
>>-		private static SolidBrush aqua = null;
>>-		private static SolidBrush aquamarine = null;
>>    
>>
>[snip]
>  
>
>>+		static SolidBrush aliceBlue;
>>+		static SolidBrush antiqueWhite;
>>+		static SolidBrush aqua;
>>+		static SolidBrush aquamarine;
>>    
>>
>
>I think this would be great as a compiler optimization.  (In fact, GCC
>has something similar for move '=0' static initializers to the BSS.)
>  
>

I am working on this but for instance fields only. For static fields it 
is more complicated but possible to implement for some special cases. 
Because you can remove hidden dependency
of static constructors.

Regards,
Marek



More information about the Mono-devel-list mailing list