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

Genericized PackedIntArray and co to PackedArray. #9907

Closed
wants to merge 5 commits into from
Closed

Genericized PackedIntArray and co to PackedArray. #9907

wants to merge 5 commits into from

Conversation

tgschultz
Copy link
Contributor

PackedArray will accept packed structs too.
Cleaned up documentation.

PackedArray will accept packed structs too.
Cleaned up documentation.
lib/std/packed_array.zig Outdated Show resolved Hide resolved
@andrewrk
Copy link
Member

andrewrk commented Oct 7, 2021

The CI failure is zig fmt related:

+ release/bin/zig fmt --check ..
../lib/std/packed_array.zig

@tgschultz
Copy link
Contributor Author

Interesting failure: the packed struct test is failing on MIPS, which I suspect is due to endianness behavior. I can't think of a reason that would be though. I'm going to have to set up a way to test MIPS locally to work it out.

@tgschultz
Copy link
Contributor Author

I believe the compiler's behavior regarding @bitCast on big endian is incorrect. I have described the issue in #9914. I believe it is possible to hack around this, but for the moment I consider this PR blocked.

@tgschultz
Copy link
Contributor Author

After extensive experimentation, I have determined that big endian packed structs are so utterly broken that I cannot even work around the problem by working with the bytes directly. When creating a struct instance from bytes directly, even when the resulting in-memory representation is identical to the original, the member values are interpreted differently.

For the current version of zig, genericizing PackedArray is hopeless. Therefore I am closing this PR. I will create a new one with the simplifications and documentation improvements but without support for packed structs.

@tgschultz tgschultz closed this Oct 8, 2021
@tgschultz tgschultz deleted the zig-PackedArray branch October 8, 2021 15:26
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.

3 participants