-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-VM-meta-monosize-reductionIssues impacting final app size primary for size sensitive workloadsIssues impacting final app size primary for size sensitive workloads
Milestone
Description
In Mono class setup we hardcode dependency on 3 interfaces which are rarely needed and could be removed if we didn't have runtime dependency.
We should fix the metadata loaded to not require the presence of
- System.Collections.Generic.IList`1
- System.Collections.Generic.IReadOnlyCollection`1
- System.Collections.Generic.IReadOnlyList`1
Or any of their individual methods
runtime/src/mono/mono/metadata/class-init.c
Lines 3717 to 3732 in df4c719
| /* IList and IReadOnlyList -> 2x if enum*/ | |
| interface_count = klass->element_class->enumtype ? 4 : 2; | |
| interfaces = (MonoClass **)mono_image_alloc0 (klass->image, sizeof (MonoClass*) * interface_count); | |
| args [0] = m_class_get_byval_arg (m_class_get_element_class (klass)); | |
| interfaces [0] = mono_class_bind_generic_parameters ( | |
| mono_defaults.generic_ilist_class, 1, args, FALSE); | |
| interfaces [1] = mono_class_bind_generic_parameters ( | |
| mono_defaults.generic_ireadonlylist_class, 1, args, FALSE); | |
| if (klass->element_class->enumtype) { | |
| args [0] = mono_class_enum_basetype_internal (klass->element_class); | |
| interfaces [2] = mono_class_bind_generic_parameters ( | |
| mono_defaults.generic_ilist_class, 1, args, FALSE); | |
| interfaces [3] = mono_class_bind_generic_parameters ( | |
| mono_defaults.generic_ireadonlylist_class, 1, args, FALSE); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-VM-meta-monosize-reductionIssues impacting final app size primary for size sensitive workloadsIssues impacting final app size primary for size sensitive workloads