Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

mem.clear vs mem.fill #7

Closed
binji opened this issue Feb 1, 2018 · 4 comments
Closed

mem.clear vs mem.fill #7

binji opened this issue Feb 1, 2018 · 4 comments

Comments

@binji
Copy link
Member

binji commented Feb 1, 2018

This topic came up a while ago, and again later.

We decided on set_memory/memset/mem.fill, but IMO this operation makes less sense when you look at the table equivalent, table.fill, since we currently have no good way to provide an immediate value.

Is it better to start with mem.clear and table.clear first, and add mem.fill later if desired?

@rossberg
Copy link
Member

rossberg commented Feb 2, 2018

I kind of expect that we gonna have table.get/set in a similar timeframe, at which point table.fill would already work. So it may not be worth bothering with adding clear methods.

@binji
Copy link
Member Author

binji commented Feb 5, 2018

OK, sounds good. For now, I'll move forward with this proposal with mem.fill but without table.fill and will update later when we have something concrete for table.{get,set}.

@lars-t-hansen
Copy link
Contributor

With the reftypes proposal, table.clear == table.fill with ref.null even for table-of-funcref, and there is (as Andreas says) also table.get and table.set to complement that, for table-of-anyref. If it becomes hard to spec table.fill here let's move it into reftypes.

@lars-t-hansen
Copy link
Contributor

table.fill is coming with reference types (WebAssembly/reference-types#14).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants