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

Update Table::grow's return to be the previous size #1653

Merged
merged 2 commits into from
May 5, 2020

Conversation

alexcrichton
Copy link
Member

This brings it in line with Memory::grow and the table.grow
instruction which return the size of the table previously, not the size
of the table currently.

This brings it in line with `Memory::grow` and the `table.grow`
instruction which return the size of the table previously, not the size
of the table currently.
@github-actions github-actions bot added the wasmtime:api Related to the API of the `wasmtime` crate itself label May 4, 2020
@github-actions
Copy link

github-actions bot commented May 4, 2020

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@@ -46,7 +46,8 @@ impl Table {
/// Returns `None` if table can't be grown by the specified amount
/// of elements.
pub fn grow(&self, delta: u32) -> Option<u32> {
let new_len = match self.size().checked_add(delta) {
let size = self.size();
Copy link
Member

@peterhuene peterhuene May 5, 2020

Choose a reason for hiding this comment

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

Nit: should we document what this function returns in the Some case?

@alexcrichton alexcrichton merged commit 8e934e6 into bytecodealliance:master May 5, 2020
@alexcrichton alexcrichton deleted the fix-table-grow branch May 5, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants