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

Support WebAssembly Tables #13

Open
veewee opened this issue Apr 15, 2023 · 0 comments
Open

Support WebAssembly Tables #13

veewee opened this issue Apr 15, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@veewee
Copy link
Owner

veewee commented Apr 15, 2023

See:

$table = new Wasm\Table(minimum: 2, maximum: null, type: 'i32', init: $initValue);

$instance = Wasm\InstanceBuilder::fromWat($wat)
    ->withImports(['env' => ['someTable' => $table]])
    ->build();


$table = $instance->getTable();
$table->set(0, 1);
$table->get(0);
$table->count(); // implements \Countable
$table->grow(2, $initValue);

// possibly:
[...$table] // implements Iterator | IteratorAggregate
@veewee veewee added enhancement New feature or request help wanted Extra attention is needed labels Apr 15, 2023
@veewee veewee added this to the 0.1.0 milestone Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Todo
Development

No branches or pull requests

1 participant