[Mono-bugs] [Bug 77530][Nor] Changed - [PATCH] serialization of integral enum value is not correct

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Feb 21 14:29:38 EST 2006


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 lluis at ximian.com.

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

--- shadow/77530	2006-02-21 12:52:50.000000000 -0500
+++ shadow/77530.tmp.12786	2006-02-21 14:29:38.000000000 -0500
@@ -227,6 +227,25 @@
 information already available in the Members array), but I trust your 
 judgement on this.
 
 How should I proceed on this ?
 
 
+
+------- Additional Comments From lluis at ximian.com  2006-02-21 14:29 -------
+> Will that string[] in the generated code not be inlined anyway, or do 
+> you recon we should define it as a const variable in the generated 
+> method ?
+
+The array won't be inlined because it is a mutable object, so a new
+instance will be created at every call. So yes, you need to generate a
+static variable to cache it.
+
+> Also, I'm not convinced that caching any of these arrays in EnumMap 
+> is really worth the additional memory usage (as we have the same 
+> information already available in the Members array), but I trust your 
+> judgement on this.
+
+The additional memory usage is only for the array, since the strings
+are shared. Creating the array over and over is far worse than
+allocating the same array only once for ever. Not only for performance
+but also to avoid memory fragmentation.


More information about the mono-bugs mailing list