[Mono-bugs] [Bug 80508][Nor] Changed - code quality regression for array init

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Jan 14 16:04:52 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by marek.safar at seznam.cz.

http://bugzilla.ximian.com/show_bug.cgi?id=80508

--- shadow/80508	2007-01-14 12:58:54.000000000 -0500
+++ shadow/80508.tmp.23548	2007-01-14 16:04:52.000000000 -0500
@@ -70,6 +70,24 @@
 ------- Additional Comments From miguel at ximian.com  2007-01-14 12:58 -------
 The change was done in 59040, the original value was six, instead of 200.
 
 I would go up to 10.
 
 
+
+------- Additional Comments From marek.safar at seznam.cz  2007-01-14 16:04 -------
+I am working on the solution but it is not that simple as you may
+think. I also need to fix some other issues exposed by this change.
+
+Here is my proposal
+
+// Emit static initializer only for arrays which size has more than 8
+items and
+// the static initializer will initialize at least 50% of array values.
+// NOTE: const_initializers_count contains a number of non-default
+constant values.
+if (const_initializers_count > 8 && const_initializers_count >
+(array_data.Count >> 1) && TypeManager.IsPrimitiveType
+(array_element_type)) {
+	EmitStaticInitializers (ec);
+}
+


More information about the mono-bugs mailing list