-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
This new method would accept an "object" to which a Value could be copied instead of being unnecessarily boxed. Example of use would look like this:
static object boxedFloat = null;
....
boxedFloat = fieldInfo.GetValue( myObject, boxedFloat );
Boxing of the value would occur only once. This would eliminate unnecessarily memory allocations in situations when GetValue is called many times. When method is used on a class types, copying would not occur and stored object would be returned instead.
One of the uses of GetValue method is User Interface based on MVVM (Model View Viewmodel) where values used to control an UI are pulled directly from the data. In realtime applications (like games) this boxing makes hundreds if not thousands of unnecessary memory allocations every second.
Metadata
Metadata
Assignees
Labels
No labels