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

C3 alignment suggestion #48

Open
spikeysnack opened this issue Sep 12, 2024 · 1 comment
Open

C3 alignment suggestion #48

spikeysnack opened this issue Sep 12, 2024 · 1 comment

Comments

@spikeysnack
Copy link

from alignment search c3 website:

A non-packed struct has the alignment of the member that has the highest alignment.
A packed struct has alignment 1.

https://c3-lang.org/references/docs/specification/#align-attribute

for details on changing the alignment.

struct Foo @align(8)
{
int a;
}

uint a = Foo.alignof; // 8

macro new_aligned($Type, ...) @NODISCARD
macro new_array_aligned($Type, usz elements) @NODISCARD

So if you want to use VectorN specify an acceptible alignment for wasm?

@rexim
Copy link
Member

rexim commented Sep 13, 2024

Feel free to submit a working PR that demonstrates that in the actual code of the project.

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

No branches or pull requests

2 participants