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

Simplify WasmPtr code #2157

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Simplify WasmPtr code #2157

merged 1 commit into from
Mar 5, 2021

Conversation

MarkMcCaskey
Copy link
Contributor

std::mem::size_of::<T>() already accounts for end padding. The align_of code
was not only a no-op, it would be incorrect if it wasn't.

Thanks to Matt Itamenye on the wasmerians slack for pointing this out!

This PR does not change any behavior, only removes misleading code.

`std::mem::size_of::<T>()` already accounts for end padding. The `align_of` code
was not only a no-op, it would be incorrect if it wasn't.

Thanks to Matt Itamenye on the wasmerians slack for pointing this out!
@MarkMcCaskey MarkMcCaskey requested a review from Hywan as a code owner March 2, 2021 14:41
Copy link
Contributor

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

You may want to take a look at Layout, but mem::size_of does the job in this case.

@Hywan Hywan self-assigned this Mar 2, 2021
@Hywan Hywan added 🎉 enhancement New feature! 📦 lib-api About wasmer labels Mar 2, 2021
@jubianchi
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Mar 4, 2021
2157: Simplify WasmPtr code r=jubianchi a=MarkMcCaskey

`std::mem::size_of::<T>()` already accounts for end padding. The `align_of` code
was not only a no-op, it would be incorrect if it wasn't.

Thanks to Matt Itamenye on the wasmerians slack for pointing this out!


This PR does not change any behavior, only removes misleading code.


Co-authored-by: Mark McCaskey <[email protected]>
@bors
Copy link
Contributor

bors bot commented Mar 4, 2021

This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried.

bors bot added a commit that referenced this pull request Mar 4, 2021
2157: Simplify WasmPtr code r=jubianchi a=MarkMcCaskey

`std::mem::size_of::<T>()` already accounts for end padding. The `align_of` code
was not only a no-op, it would be incorrect if it wasn't.

Thanks to Matt Itamenye on the wasmerians slack for pointing this out!


This PR does not change any behavior, only removes misleading code.


Co-authored-by: Mark McCaskey <[email protected]>
@bors
Copy link
Contributor

bors bot commented Mar 5, 2021

Build failed:

@MarkMcCaskey
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 5, 2021

@bors bors bot merged commit 07464c7 into master Mar 5, 2021
@bors bors bot deleted the fix/simplify-wasmptr branch March 5, 2021 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! 📦 lib-api About wasmer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants