Skip to content

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

Merged
alexcrichton merged 2 commits intobytecodealliance:masterfrom
alexcrichton:fix-table-grow
May 5, 2020
Merged

Update Table::grow's return to be the previous size#1653
alexcrichton merged 2 commits intobytecodealliance:masterfrom
alexcrichton:fix-table-grow

Conversation

@alexcrichton
Copy link
Copy Markdown
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
Copy Markdown

github-actions bot commented May 4, 2020

Subscribe to Label Action

cc @peterhuene

Details 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.

/// 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
Copy Markdown
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