Skip to content

Added nullaryOpAlignOf for primitives #578

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

Merged
merged 2 commits into from
May 9, 2025
Merged

Conversation

dkcumming
Copy link
Collaborator

nullaryOpAlignOf for primitives:

  • Returns correct values for u{8,16,32,64,128}, i{8,16,32,64,128}, bool, char, floats;
  • Assumes usize and isize are 64bit;
  • Hardcoded return size of 64bit since isize and usize assume 64bit currently;

We already have tests that trigger this however they are going to require thunk to be implemented to get past the casts.

Also I feel alignment should be platform specific, so I added a FIXME because I believe this values are essentially assumptions. Or am I misunderstanding?

@dkcumming dkcumming self-assigned this May 9, 2025
Copy link
Contributor

@gtrepta gtrepta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think the FIXMEs are appropriate for now.

@dkcumming dkcumming merged commit d131a7d into master May 9, 2025
6 checks passed
@dkcumming dkcumming deleted the dc/primitive-align-of branch May 9, 2025 21:06
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