Skip to content

wasm: align heap to 16 bytes #2014

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 1 commit into from
Jul 30, 2021
Merged

wasm: align heap to 16 bytes #2014

merged 1 commit into from
Jul 30, 2021

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Jul 25, 2021

This PR fixes two things:

  • It changes the alignment to 16 bytes (from 4), to match max_align_t in C.
  • It manually aligns heapStart on WebAssembly, to work around a bug in wasm-ld with --stack-first (see https://reviews.llvm.org/D106499).

This commit fixes two things:

  * It changes the alignment to 16 bytes (from 4), to match max_align_t
    in C.
  * It manually aligns heapStart on WebAssembly, to work around a bug in
    wasm-ld with --stack-first (see https://reviews.llvm.org/D106499).
@fgsch
Copy link
Contributor

fgsch commented Jul 25, 2021

Perhaps this can also add a test from #2010 ?

@aykevl
Copy link
Member Author

aykevl commented Jul 25, 2021

Hmm, perhaps yes. I'm not sure though as checking for alignment does not guarantee anything: the pointer can also be aligned by chance.

@fgsch
Copy link
Contributor

fgsch commented Jul 27, 2021

Either way, this looks good to me 👍

@deadprogram
Copy link
Member

Thank you, everyone. Now merging.

@deadprogram deadprogram merged commit 65c1978 into dev Jul 30, 2021
@deadprogram deadprogram deleted the wasm-heap-align-workaround branch July 30, 2021 06:38
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.

4 participants