-
Notifications
You must be signed in to change notification settings - Fork 5.3k
CoreCLR support for InlineArrayAttribute. (struct layout part) #82744
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
Changes from 1 commit
da7b00b
170a306
bb1c3db
0a4cd78
6eeb887
f0d156b
470aee2
78ab523
a452be7
2801f50
e3284d1
4ff0a25
b406dfe
7f197d6
1852993
295caf1
e7738ea
065467b
62b20c8
01e2e17
f844772
1b5f608
bf676e4
7d42fbc
7fff2be
2d403ee
f6f6acc
d68cfa2
ebc698b
9373c77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1715,7 +1715,7 @@ MethodTableBuilder::BuildMethodTableThrowing( | |
| if (repeat > 0) | ||
| { | ||
| bmtFP->NumInlineArrayElements = repeat; | ||
| GetHalfBakedClass()->SetInlineArrayFlag(); | ||
| GetHalfBakedClass()->SetIsInlineArray(); | ||
| } | ||
| else | ||
| { | ||
|
|
@@ -1749,7 +1749,7 @@ MethodTableBuilder::BuildMethodTableThrowing( | |
|
|
||
| _ASSERTE(HasLayout()); | ||
|
|
||
| if (bmtFP->NumInlineArrayElements) | ||
| if (bmtFP->NumInlineArrayElements != 0) | ||
| { | ||
| GetLayoutInfo()->m_cbManagedSize *= bmtFP->NumInlineArrayElements; | ||
| } | ||
|
|
@@ -11556,7 +11556,6 @@ VOID MethodTableBuilder::HandleGCForValueClasses(MethodTable ** pByValueClassCac | |
| DWORD repeat = 1; | ||
| if (bmtFP->NumInlineArrayElements > 1) | ||
| { | ||
| _ASSERTE(bmtEnumFields->dwNumInstanceFields == 1); | ||
| repeat = bmtFP->NumInlineArrayElements; | ||
| } | ||
|
|
||
|
|
@@ -11583,6 +11582,9 @@ VOID MethodTableBuilder::HandleGCForValueClasses(MethodTable ** pByValueClassCac | |
| DWORD dwCurrentOffset = pFieldDescList[i].GetOffset_NoLogging(); | ||
| DWORD dwElementSize = pByValueMT->GetBaseSize() - OBJECT_BASESIZE; | ||
|
|
||
| // if we have an inline array, we will have only one formal instance field, | ||
| // but will have to replicate the layout "repeat" times. | ||
| // otherwise every field will be matched with 1 serie. | ||
| for (DWORD r = 0; r < repeat; r++) | ||
|
||
| { | ||
| // The by value class may have more than one pointer series | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,9 @@ | |
|
|
||
| namespace System.Runtime.CompilerServices | ||
| { | ||
| /// <summary> | ||
| /// Indicates that the instance's storage is sequentially replicated "length" times. | ||
| /// </summary> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| [AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] | ||
| public sealed class InlineArrayAttribute : Attribute | ||
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or please change the
BOOLto aDWORD.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively just use
booland update to? true : falseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of the helpers in this file do
? TRUE : FALSE;, but some returnDWORD.I'll make this
DWORD, to fit the style.