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

Structs with variable length inline arrays MUST be blittable #195

Closed
AArnott opened this issue Mar 16, 2021 · 1 comment · Fixed by #1127
Closed

Structs with variable length inline arrays MUST be blittable #195

AArnott opened this issue Mar 16, 2021 · 1 comment · Fixed by #1127
Assignees

Comments

@AArnott
Copy link
Member

AArnott commented Mar 16, 2021

An array that contains a variable length inline array (e.g. RTM_ENTITY_EXPORT_METHODS) must be blittable because custom memory management is the only way to handle it.
We should recognize this and emit a blittable (non-marshaled) version even when AllowMarshaling is set to true.

If that same struct contains other fields that require marshaling, perhaps we just error out when emitting because it's an impossible thing to properly support.

@AArnott
Copy link
Member Author

AArnott commented Jun 15, 2022

With #292 fixed, we have the tools necessary to recognize and require that a struct be unmanaged (i.e. blittable). For this issue then, we should recognize that the structs identified in this issue are among those that trigger the blittable requirement.
We could change our IsManaged test to return false for these structs since a managed version will never be emitted, thereby avoiding the suffix that would otherwise be appended to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant