Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix boxing empty blittable arrays #1158

Merged
merged 4 commits into from
Apr 5, 2022
Merged

Conversation

manodasanW
Copy link
Member

For blittable arrays, we make use of ReadOnlySpan to create the array. But when the array is empty, it seems we can get back the same array each time we call it. This causes issues when different instances of empty arrays are boxed in WinRT and we try to create an RCW for them because RCW creation expects it to be a new object. Addressing this by handling the empty array case to return a new empty array.

Also added tests which demonstrate this doesn't impact the non blittable array scenarios which don't make use of ReadOnlySpan.

Fixes #1146

@manodasanW manodasanW requested a review from ujjwalchadha April 4, 2022 19:07
@manodasanW manodasanW merged commit 574fc76 into master Apr 5, 2022
@manodasanW manodasanW deleted the manodasanw/fixboxingarrays branch April 5, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants