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

A question about page size relocation #21

Closed
yamt opened this issue May 28, 2024 · 4 comments
Closed

A question about page size relocation #21

yamt opened this issue May 28, 2024 · 4 comments

Comments

@yamt
Copy link
Contributor

yamt commented May 28, 2024

the overview states it's ideal to use a relocation for page size.
why do you prefer a relocation over eg. an immutable global?

@fitzgen
Copy link
Collaborator

fitzgen commented May 28, 2024

Six of one, half a dozen of another. Both approaches should enable const-folding/-propagation and avoids accessing memory, which tends to inhibit compiler optimization.

@yamt
Copy link
Contributor Author

yamt commented May 29, 2024

if there is little differences, i guess it's simpler to use a global instead.

@fitzgen
Copy link
Collaborator

fitzgen commented May 29, 2024

I would say "simpler" is a matter of opinion. I personally find an i32.const to be "simpler" but it looks like wasm-ld will probably use a global instead. Again either way works fine.

Happy to accept a PR to the overview clarifying that either an i32.const or a global and global.get would satisfy the constraints, if you want to make one.

yamt added a commit to yamt/custom-page-sizes that referenced this issue Jun 5, 2024
yamt added a commit to yamt/custom-page-sizes that referenced this issue Jun 6, 2024
@fitzgen
Copy link
Collaborator

fitzgen commented Jun 13, 2024

This was addressed in #22.

@fitzgen fitzgen closed this as completed Jun 13, 2024
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