[Mono-bugs] [Bug 328036] [PATCH]Casting bug with generic collections

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 25 10:25:14 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=328036#c6





--- Comment #6 from Paolo Molaro <lupus at novell.com>  2007-09-25 08:25:14 MST ---
I guess you could commit, since it fixes the bug, but the code is really slow:
for reference types we could try a cast to object[] and do the stores to that.
For value types the code will box all the keys and values which would be bad.
To handle them you might want to try a cast to Tkey[] or TValue[] depending on
the collection (do this after the check for object[]) and do the stores using
that. It's likely good to separate the two implementations in two different
helper functions. If the casts fail I guess going for the slow code is the
lesser evil. There are a couple of places in the same files where the similarly
slow code is used, it would be great if you could fix those, too.
We also likely need test cases to see how the MS runtime behaves when the
target array is an int[] and we have a byte dictionary or things like that.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list