Skip to content

Conversation

@Technus
Copy link

@Technus Technus commented Feb 13, 2025

Changed null checks to pattern matching to avoid ==/!= overloads.
Added testing for more .NET platforms.
Fixed failing test was MASTER_STRUCTFieldsRecursive by:
Added Declaring class Sorting.
Added Interleaved Padding support.

TODO:

  • Needs check if behavioir is repeatable on x86/x64 - added tests as it might change the alignment layout. (Count of paddings might change) - Added tests

  • Also it seems that the struct packing behavioir changes based on .NET version. (So counts of paddings may vary) - Added tests to .net framework and core

  • Added some support for Inline Arrays (.Net 8) and tests

AFAIK This will not make the code output invalid values for fields but hardcoded test assertions might make the tests fail.

@Technus Technus marked this pull request as draft February 13, 2025 22:17
@SergeyTeplyakov
Copy link
Owner

Tha change looks very promissing. Thanks a lot!

@Technus Technus marked this pull request as ready for review February 17, 2025 23:08
@Technus
Copy link
Author

Technus commented Feb 17, 2025

Also enforced Padder to insert padding even for empty/not full classes/structs.

@Technus Technus changed the title Fix for Unions Fix for Unions, Padding, x86/x64, some .NET versions sanity check in tests Feb 17, 2025
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 this pull request may close these issues.

2 participants